I use loggerFactory.AddFile(AppSettings.Configuration.GetSection("Logging:Serilog"));
in Startup.Configure
, when appsettings.json
file changed, i want update the settings of serilog.
I use ChangeToken.OnChange
for response the changing:
ChangeToken.OnChange(() => AppSettings.Configuration.GetReloadToken(), env_ =>
{
//how to reconfigure serilog?
}, env);