简体   繁体   English

serilog 中配置文件中的 CallerLineNumber

[英]CallerLineNumber from config file in serilog

Is there a way to configure CallerLineNumber from config file in C# ?有没有办法从CallerLineNumber中的配置文件配置C# I have gone through https://stackoverflow.com/a/46905798/5035500 and https://gist.github.com/litetex/b88fe0531e5acea82df1189643fb1f79 which are good examples but the configuration is in C# code.我已经浏览了https://stackoverflow.com/a/46905798/5035500https://gist.github.com/litetex/b88fe0531e5acea82df1189643fb1f79 ,但配置是 48 code9819 中的 48570

CallerLineNumber is not something Serilog supports out-of-the-box... The examples you mentioned are all custom abstractions on top of Serilog. CallerLineNumber不是 Serilog 开箱即用的支持......你提到的例子都是 Serilog 之上的自定义抽象。

If you want to control this behavior via config, you'll have to write your own custom code to read specific parameters from the config file and set up the Serilog pipeline accordingly.如果您想通过配置来控制此行为,则必须编写自己的自定义代码以从配置文件中读取特定参数并相应地设置 Serilog 管道。

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

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