71 lines
2.6 KiB
JSON
71 lines
2.6 KiB
JSON
{
|
|
"Serilog": {
|
|
"Using": [
|
|
"Serilog.Sinks.Console",
|
|
"Serilog.Sinks.MongoDB",
|
|
"Serilog.Sinks.Async"
|
|
],
|
|
"MinimumLevel": {
|
|
"Default": "Information",
|
|
"Override": {
|
|
"Microsoft": "Warning",
|
|
"Microsoft.EntityFrameworkCore.Database.Command": "Warning",
|
|
"Microsoft.AspNetCore.Mvc.Infrastructure": "Warning"
|
|
}
|
|
},
|
|
"WriteTo": [
|
|
{
|
|
"Name": "Async",
|
|
"Args": {
|
|
"configure": [
|
|
{
|
|
"Name": "File",
|
|
"Args": {
|
|
"path": "logs/myapp-.log",
|
|
"rollingInterval": "Day",
|
|
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [{Level:u3}] {Message:lj}{NewLine}{Exception}",
|
|
"fileSizeLimitBytes": 1073741824, // 1 GB
|
|
"retainedFileCountLimit": 100, // Retain 100 files
|
|
"buffered": true, // use async logging
|
|
"flushToDiskInterval": "00:00:30" // flush every 30 seconds
|
|
}
|
|
},
|
|
{
|
|
"Name": "Console",
|
|
"Args": {
|
|
"outputTemplate": "[{Timestamp:yyyy/MM/dd HH:mm} {Level:u3}] {SourceContext}:{NewLine} {Message:lj}{NewLine}{Properties:j}{Exception}{NewLine}"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
|
|
],
|
|
"Enrich": [
|
|
"FromLogContext",
|
|
"WithMachineName",
|
|
"WithThreadId"
|
|
]
|
|
},
|
|
|
|
"WhiteList": {
|
|
"ContentType": [
|
|
"application/pdf", // pdf
|
|
"application/msword", // Doc
|
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document", //docx
|
|
"application/vnd.ms-excel", //xls
|
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", //xlsx
|
|
"application/mspowerpoint", //ppt
|
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation", //pptx
|
|
"text/plain", //txt
|
|
"application/rtf", //rtf
|
|
"text/csv", //csv
|
|
"image/jpg", //jpg
|
|
"image/jpeg", //jpeg
|
|
"image/png", //png
|
|
"image/gif", //gif
|
|
"image/bmp" //bmp
|
|
]
|
|
}
|
|
}
|