FIx error `The logger is already frozen`
This commit is contained in:
parent
7a6c1d8481
commit
963649b2b7
|
@ -58,7 +58,13 @@ public static class Program
|
|||
});
|
||||
});
|
||||
|
||||
builder.Host.UseSerilog(Log.Logger);
|
||||
builder.Host.UseSerilog((context, services, config) =>
|
||||
{
|
||||
config.ReadFrom.Configuration(context.Configuration)
|
||||
.ReadFrom.Services(services)
|
||||
.Enrich.FromLogContext();
|
||||
// .WriteTo.Console();
|
||||
}, true);
|
||||
// init App.service
|
||||
App.services = builder.Services;
|
||||
var app = builder.Build();
|
||||
|
|
Loading…
Reference in New Issue