Skip to content

Commit d5eccdf

Browse files
author
Sergey Tregub
committed
Improve Serilog configuration
1 parent fdff5c8 commit d5eccdf

2 files changed

Lines changed: 16 additions & 9 deletions

File tree

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"Serilog": {
33
"MinimumLevel": {
4-
"Default": "Debug",
5-
"Override": {
6-
"Microsoft": "Debug",
7-
"System": "Debug"
8-
}
4+
"Default": "Debug"
95
}
106
}
117
}

ProjectTemplates/ReferenceProject/appsettings.json

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
11
{
22
"Serilog": {
33
"MinimumLevel": {
4-
"Default": "Warning",
4+
"Default": "Information",
55
"Override": {
66
"Microsoft": "Warning",
7+
"Microsoft.Hosting": "Information",
78
"System": "Warning"
89
}
910
},
11+
"Filter": [],
1012
"WriteTo": [
1113
{
1214
"Name": "File",
1315
"Args": {
1416
"path": "%AppData%/Logs/ReferenceProject.log",
15-
"rollingInterval": "Day",
16-
"buffered": false
17+
"rollOnFileSizeLimit": true,
18+
"fileSizeLimitBytes": 10485760,
19+
"retainedFileCountLimit": 10,
20+
"buffered": false,
21+
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message:lj}{NewLine}{Exception}"
1722
}
1823
},
1924
{
20-
"Name": "Console"
25+
"Name": "Console",
26+
"Args": {
27+
"outputTemplate": "[{Timestamp:HH:mm:ss}] [{Level:u3}] {Message:lj}{NewLine}{Exception}"
28+
}
2129
}
30+
],
31+
"Enrich": [
32+
"FromLogContext"
2233
]
2334
},
2435
"AllowedHosts": "*",

0 commit comments

Comments
 (0)