{
"Serilog": {
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File", "Serilog.Settings.Configuration" ],
"MinimumLevel": {
"Default": "Debug",
"Override": {
"Default": "Warning",
"System": "Warning",
"Microsoft": "Warning"
}
},
"Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ],
"WriteTo": [
{
"Name": "Console",
"Args": {
"restrictedToMinimumLevel": "Information",
"theme": "Serilog.Sinks.SystemConsole.Themes.SystemConsoleTheme::Literate, Serilog.Sinks.Console"
}
},
{
"Name": "File",
"Args": {
"path": "{CurrentDirectory}/logs/trace/trace-.log",
"rollingInterval": "Day",
"fileSizeLimitBytes": 52428800,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{ThreadId} {Level:u3}] {Message:lj} {NewLine}{Exception}",
"restrictedToMinimumLevel": "Verbose"
}
},
{
"Name": "File",
"Args": {
"path": "{CurrentDirectory}/logs/debug/debug-.log",
"rollingInterval": "Day",
"fileSizeLimitBytes": 52428800,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{ThreadId} {Level:u3}] {Message:lj} {NewLine}{Exception}",
"restrictedToMinimumLevel": "Debug"
}
},
{
"Name": "File",
"Args": {
"path": "{CurrentDirectory}/logs/info/info-.log",
"rollingInterval": "Day",
"fileSizeLimitBytes": 52428800,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{ThreadId} {Level:u3}] {Message:lj} {NewLine}{Exception}",
"restrictedToMinimumLevel": "Information"
}
},
{
"Name": "File",
"Args": {
"path": "{CurrentDirectory}/logs/warning/warning-.log",
"rollingInterval": "Day",
"fileSizeLimitBytes": 52428800,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{ThreadId} {Level:u3}] {Message:lj} {NewLine}{Exception}",
"restrictedToMinimumLevel": "Warning"
}
},
{
"Name": "File",
"Args": {
"pat
Serilog 日志使用配置文件加载
最新推荐文章于 2024-06-08 22:49:41 发布