AddEnvironmentVariables fix
parent
958a8499f8
commit
3757a25ed1
|
@ -27,6 +27,7 @@ namespace IdentityServer.Api
|
|||
var configuration = new ConfigurationBuilder()
|
||||
.SetBasePath(Directory.GetCurrentDirectory())
|
||||
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
||||
.AddEnvironmentVariables()
|
||||
.Build();
|
||||
|
||||
var connectionString = configuration.GetConnectionString("DatabaseConnection");
|
||||
|
@ -42,14 +43,18 @@ namespace IdentityServer.Api
|
|||
|
||||
var mssqlSinkOptions = new MSSqlServerSinkOptions() { AutoCreateSqlTable = true, TableName = "__Logs" };
|
||||
|
||||
Serilog.Debugging.SelfLog.Enable(msg => Console.WriteLine(msg));
|
||||
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
.MinimumLevel.ControlledBy(loggingLevelSwitch)
|
||||
.MinimumLevel.Verbose()
|
||||
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
|
||||
.Enrich.FromLogContext()
|
||||
.WriteTo.Console()
|
||||
.WriteTo.MSSqlServer(connectionString, mssqlSinkOptions, columnOptions: columnOptions)
|
||||
.CreateLogger();
|
||||
|
||||
Serilog.Debugging.SelfLog.Enable(msg => Console.WriteLine(msg));
|
||||
|
||||
try
|
||||
{
|
||||
var urls = configuration.GetValue<string>("urls");
|
||||
|
|
Loading…
Reference in New Issue