File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed
Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change 1+ using System . Globalization ;
12using Api . Setup ;
23using Azure . Identity ;
34using Serilog ;
910 . AddJsonFile ( "appsettings.json" , optional : false , reloadOnChange : true )
1011 . Build ( ) ;
1112
13+ const string logFormat = "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message:lj}{NewLine}{Exception}" ;
14+
1215Log . Logger = new LoggerConfiguration ( )
1316 . ReadFrom . Configuration ( config )
17+ . WriteTo . Console ( outputTemplate : logFormat , formatProvider : CultureInfo . InvariantCulture )
1418 . CreateLogger ( ) ;
1519
1620var builder = WebApplication . CreateBuilder ( args ) ;
Original file line number Diff line number Diff line change 77 }
88 },
99 "Serilog" : {
10- "Using" : [" Serilog.Sinks.Console" ],
1110 "MinimumLevel" : {
1211 "Default" : " Information" ,
1312 "Override" : {
1413 "Microsoft" : " Information" ,
1514 "Microsoft.AspNetCore" : " Warning"
1615 }
17- },
18- "WriteTo" : [
19- {
20- "Name" : " Console" ,
21- "Args" : {
22- "outputTemplate" : " [{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message:lj}{NewLine}{Exception}"
23- }
24- }
25- ]
16+ }
2617 },
2718 "AllowedHosts" : " *"
2819}
You can’t perform that action at this time.
0 commit comments