SHA256
Added Serilog for improved logs
- Logs will be shown by console and stored in files.
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"Serilog": {
|
||||
"Using": [
|
||||
"Serilog.Sinks.Console",
|
||||
"Serilog.Sinks.File"
|
||||
],
|
||||
"MinimumLevel": {
|
||||
"Default": "Information",
|
||||
"Override": {
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.EntityFrameworkCore.Database.Command": "Warning"
|
||||
}
|
||||
},
|
||||
"Enrich": [
|
||||
"FromLogContext",
|
||||
"WithThreadId",
|
||||
"WithProcessId"
|
||||
],
|
||||
"Properties": {
|
||||
"ApplicationName": "Somnia-GuestLog"
|
||||
},
|
||||
"WriteTo": [
|
||||
{
|
||||
"Name": "Console",
|
||||
"Args": {
|
||||
"restrictedToMinimumLevel": "Information"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "File",
|
||||
"Args": {
|
||||
// Logs data path
|
||||
"path": "/SomniaGuestLog/logs/log_.log",
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{ProcessId}-{ThreadId}] [{Level}] {JobKey}{Message}{NewLine}{Exception}",
|
||||
"rollingInterval": "Day",
|
||||
"rollOnFileSizeLimit": true,
|
||||
"fileSizeLimitBytes": 1073741824,
|
||||
"retainedFileCountLimit": 30,
|
||||
"restrictedToMinimumLevel": "Information"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user