简体   繁体   English

读取当前 Serilog 的配置

[英]Read current Serilog's configuration

Is there a property / method in Serilog where I could (programmatically) check the current configuration? Serilog 中是否有一个属性/方法可以(以编程方式)检查当前配置? (sinks, minimum level) (水槽,最低水位)

eg 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) (在我的情况下,配置是在我的应用程序之外动态创建的)

不,没有反思的方法来检查 Serilog 配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM