NetCore|Serilog|AppSettings无法分级书写日志

{
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
},
"Enrich": [ "FromLogContext", "WithThreadId" ],
"WriteTo": [
{
"Name": "Console",
"Args": {
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} {SourceContext} {ThreadId} [{Level:u3}] {Message:lj}{NewLine}{Exception}"
}
},
{
"Name": "Error",
"Args": {
"path": "./Logs/Error/log.txt",
"formatter": "Serilog.Formatting.Compact.CompactJsonFormatter",
"rollingInterval": "Day",
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} {SourceContext} {ThreadId} [{Level:u3}] {Message:lj}{NewLine}{Exception}",
"shared": true,
"rollOnFileSizeLimit": true,
"fileSizeLimitBytes": 102400000,
"retainedFileCountLimit": 365
}
},
{
"Name": "File",
"Args": {
"path": "./Logs/Info/log.txt",
"formatter": "Serilog.Formatting.Compact.CompactJsonFormatter",
"rollingInterval": "Day",
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} {SourceContext} {ThreadId} [{Level:u3}] {Message:lj}{NewLine}{Exception}",
"shared": true,
"rollOnFileSizeLimit": true,
"fileSizeLimitBytes": 102400000,
"retainedFileCountLimit": 365
}
}
]
}
}

有没有大佬麻烦看下为什么不产生Error文件夹的日志,只有Info的呢,感谢感谢

回答

《.NET Core 跨平台-日志使用》

以上是NetCore|Serilog|AppSettings无法分级书写日志的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>