File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
src/Code.Library.AspNetCore Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ Specific to ASP.NET Core project.</Description>
2929 <PackageReference Include =" Serilog.Formatting.Elasticsearch" Version =" 8.4.1" />
3030 <PackageReference Include =" Serilog.Settings.Configuration" Version =" 3.1.0" />
3131 <PackageReference Include =" Serilog.Sinks.ApplicationInsights" Version =" 3.1.0" />
32+ <PackageReference Include =" Serilog.Sinks.Async" Version =" 1.4.0" />
3233 <PackageReference Include =" Serilog.Sinks.Console" Version =" 3.1.1" />
3334 <PackageReference Include =" Serilog.Sinks.File" Version =" 4.1.0" />
3435 <PackageReference Include =" Serilog.Sinks.Seq" Version =" 4.0.0" />
Original file line number Diff line number Diff line change @@ -104,17 +104,17 @@ public static void WithSimpleConfiguration(this LoggerConfiguration loggerConfig
104104
105105 if ( configuration . GetValue < bool > ( "Serilog:UseElasticsearchFormatter" , false ) )
106106 {
107- loggerConfig . WriteTo . Console ( new ElasticsearchJsonFormatter ( ) ) ;
107+ loggerConfig . WriteTo . Async ( a => a . Console ( new ElasticsearchJsonFormatter ( ) ) ) ;
108108 }
109109 else
110110 {
111- loggerConfig . WriteTo . Console ( ) ;
111+ loggerConfig . WriteTo . Async ( a => a . Console ( ) ) ;
112112 }
113113
114114 if ( configuration . GetValue < bool > ( "Serilog:WriteToFile" , false ) )
115115 {
116- loggerConfig . WriteTo . File ( new RenderedCompactJsonFormatter ( ) ,
117- @"logs\log.ndjson" , rollingInterval : RollingInterval . Day ) ;
116+ loggerConfig . WriteTo . Async ( a => a . File ( new RenderedCompactJsonFormatter ( ) ,
117+ @"logs\log.ndjson" , rollingInterval : RollingInterval . Day ) ) ;
118118 }
119119
120120 var seqServerUrl = configuration [ "Serilog:SeqServerUrl" ] ;
You can’t perform that action at this time.
0 commit comments