Skip to content

Commit 3694453

Browse files
committed
Simplified startup config
1 parent 3654687 commit 3694453

File tree

3 files changed

+1
-21
lines changed

3 files changed

+1
-21
lines changed

Program.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
builder.Services.AddSingleton(envConfig);
3535

3636
// Prepare logging
37-
var envLogLevel = Environment.GetEnvironmentVariable("SERILOG__MINIMUMLEVEL__DEFAULT");
37+
var envLogLevel = builder.Configuration.GetValue<string>("Serilog:MinimumLevel:Default");
3838
var logLevelSwitch = new LoggingLevelSwitch(
3939
!string.IsNullOrWhiteSpace(envLogLevel)
4040
? Enum.Parse<LogEventLevel>(envLogLevel)
@@ -51,13 +51,10 @@
5151
.WriteTo.Console();
5252

5353
builder.Host.UseSerilog();
54-
builder.Configuration.AddJsonFile("appsettings.json", optional: true, reloadOnChange: false);
5554

5655
// Support the untracked local environment variables file for development
5756
if (builder.Environment.IsDevelopment())
5857
{
59-
builder.Configuration.AddJsonFile("local.environmentvariables.json", optional: true, reloadOnChange: false);
60-
6158
// Load into environment variables as well
6259
var localEnvironmentVariables = new ConfigurationBuilder()
6360
.AddJsonFile("local.environmentvariables.json", optional: true, reloadOnChange: false)

appsettings.Development.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

appsettings.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)