问题
Is there a property / method in Serilog where I could (programmatically) check the current configuration? (sinks, minimum level)
e.g. if have this config:
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.File("log.txt")
.WriteTo.Console(restrictedToMinimumLevel: LogEventLevel.Information)
.CreateLogger();
How could I read this config later?
(In my case the config is dynamically created outside my application)
回答1:
No, there's no reflective way to examine Serilog configuration.
来源:https://stackoverflow.com/questions/56902169/read-current-serilogs-configuration