Files
StoreWeb/Core/MAX.Framework/appsettings.Serilog.json
2026-10-15 17:15:10 +08:00

142 lines
4.2 KiB
JSON

{
"Serilog": {
"Using": [
"Serilog.Sinks.Console",
"Serilog.Sinks.File",
"Serilog.Filters.Expressions"
],
"MinimumLevel": {
"Default": "Debug",
"Override": {
"Microsoft": "Information",
"Microsoft.AspNetCore": "Warning",
"System": "Warning",
"Hangfire": "Information"
}
},
"Enrich": [
"FromLogContext"
],
"Properties": {
"Application": "MyAspNetCore"
},
"WriteTo": [
{
"Name": "Logger",
"Args": {
"configureLogger": {
"Filter": [
{ "Name": "ByIncludingOnly", "Args": { "expression": "@Level = 'Debug'" } }
],
"WriteTo": [
{
"Name": "File",
"Args": {
"path": "Logs/Debug/.log",
"rollingInterval": "Day",
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}",
"retainedFileCountLimit": 365,
"fileSizeLimitBytes": 104857600,
"rollOnFileSizeLimit": true
}
}
]
}
}
},
{
"Name": "Logger",
"Args": {
"configureLogger": {
"Filter": [
{ "Name": "ByIncludingOnly", "Args": { "expression": "@Level = 'Information'" } }
],
"WriteTo": [
{
"Name": "File",
"Args": {
"path": "Logs/Info/.log",
"rollingInterval": "Day",
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}",
"retainedFileCountLimit": 365,
"fileSizeLimitBytes": 104857600,
"rollOnFileSizeLimit": true
}
}
]
}
}
},
{
"Name": "Logger",
"Args": {
"configureLogger": {
"Filter": [
{ "Name": "ByIncludingOnly", "Args": { "expression": "@Level = 'Warning'" } }
],
"WriteTo": [
{
"Name": "File",
"Args": {
"path": "Logs/Warning/.log",
"rollingInterval": "Day",
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}",
"retainedFileCountLimit": 365,
"fileSizeLimitBytes": 104857600,
"rollOnFileSizeLimit": true
}
}
]
}
}
},
{
"Name": "Logger",
"Args": {
"configureLogger": {
"Filter": [
{ "Name": "ByIncludingOnly", "Args": { "expression": "@Level = 'Error'" } }
],
"WriteTo": [
{
"Name": "File",
"Args": {
"path": "Logs/Error/.log",
"rollingInterval": "Day",
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}",
"retainedFileCountLimit": 365,
"fileSizeLimitBytes": 104857600,
"rollOnFileSizeLimit": true
}
}
]
}
}
},
{
"Name": "Logger",
"Args": {
"configureLogger": {
"Filter": [
{ "Name": "ByIncludingOnly", "Args": { "expression": "@Level = 'Fatal'" } }
],
"WriteTo": [
{
"Name": "File",
"Args": {
"path": "Logs/Fatal/.log",
"rollingInterval": "Day",
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}",
"retainedFileCountLimit": 365,
"fileSizeLimitBytes": 104857600,
"rollOnFileSizeLimit": true
}
}
]
}
}
}
]
}
}