File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed
src/Pandatech.CleanArchitecture.Infrastructure/Extensions Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change 66using Pandatech . CleanArchitecture . Core . Extensions ;
77using Pandatech . CleanArchitecture . Infrastructure . Helpers ;
88using Serilog ;
9+ using Serilog . Configuration ;
910using Serilog . Events ;
1011
1112namespace Pandatech . CleanArchitecture . Infrastructure . Extensions ;
@@ -38,31 +39,35 @@ private static LoggerConfiguration ConfigureEnvironmentSpecificSettings(this Log
3839 {
3940 if ( builder . Environment . IsLocal ( ) )
4041 {
41- loggerConfig . WriteTo . Console ( ) ;
42+ loggerConfig
43+ . WriteTo
44+ . Console ( ) ;
4245 }
4346 else if ( builder . Environment . IsDevelopment ( ) )
4447 {
4548 loggerConfig
4649 . WriteTo
4750 . Console ( )
4851 . WriteTo
49- . File ( new EcsTextFormatter ( ) ,
50- builder . GetLogsPath ( ) ,
51- rollingInterval : RollingInterval . Day ,
52- shared : true ) ;
52+ . File ( builder ) ;
5353 }
5454 else
5555 {
5656 loggerConfig
5757 . WriteTo
58- . File ( new EcsTextFormatter ( ) ,
59- builder . GetLogsPath ( ) ,
60- rollingInterval : RollingInterval . Day ,
61- shared : true ) ;
58+ . File ( builder ) ;
6259 }
6360
6461 return loggerConfig ;
6562 }
63+
64+ private static void File ( this LoggerSinkConfiguration loggerConfig , WebApplicationBuilder builder )
65+ {
66+ loggerConfig
67+ . File ( new EcsTextFormatter ( ) ,
68+ builder . GetLogsPath ( ) ,
69+ rollingInterval : RollingInterval . Day ) ;
70+ }
6671
6772 private static LoggerConfiguration FilterOutUnwantedLogs ( this LoggerConfiguration loggerConfig )
6873 {
You can’t perform that action at this time.
0 commit comments