[英]Show only debug level logs in Serilog
I want to show only debug level of logs, but none of the other levels, below or above the debug level.我只想显示调试级别的日志,但不显示低于或高于调试级别的其他级别。 Also I want to do that in the configuration in appsettings.json, not in the startup class.我也想在 appsettings.json 的配置中做到这一点,而不是在启动 class 中。 Here is my appsettings.json file这是我的 appsettings.json 文件
"Serilog": {
"MinimumLevel": {
"Default": "Debug",
"Override": {
"System": "Debug",
"Microsoft": "Debug"
}
},
"WriteTo": [
{
"Name": "Seq",
"Args": {
"serverUrl": "http://localhost:5341/",
"compact": true
}
},
{
"Name": "Console"
},
{
"Name": "File",
"Args": {
"path": "D:\\dev.SmartCity.Peafowls.Logs\\PeafowlsLog_.txt",
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] [{SourceContext}] [{EventId}] {Message}{NewLine}{Exception}",
"rollingInterval": "Day",
"rollOnFileSizeLimit": true,
"fileSizeLimitBytes": 4194304
}
}
],
"Enrich": [ "FromLogContext" ] }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.