@@ -23,7 +23,7 @@ public static LoggerConfiguration CreateDefaultLoggerConfiguration(bool withCons
2323
2424 if ( withConsoleLogger )
2525 {
26- loggerConfiguration = loggerConfiguration . WriteTo . ColoredConsole ( ) ;
26+ loggerConfiguration = loggerConfiguration . WriteTo . Console ( ) ;
2727 }
2828
2929 return loggerConfiguration ;
@@ -40,19 +40,13 @@ public static ILoggerFactory CreateLoggerFactory(
4040 loggerConfiguration = CreateDefaultLoggerConfiguration ( ) ;
4141 }
4242
43- if ( telemetryConfiguration != null
43+ if ( telemetryConfiguration != null
4444 && ! string . IsNullOrEmpty ( telemetryConfiguration . InstrumentationKey ) )
4545 {
46- // Even though this method call is marked [Obsolete],
47- // there's currently no other way to pass in the active TelemetryConfiguration as configured in DI.
48- // These SeriLog APIs are very likely to change to support passing in the TelemetryConfiguration again.
49- // See also https://github.com/serilog/serilog-sinks-applicationinsights/issues/121.
50-
51- #pragma warning disable CS0618 // Type or member is obsolete
5246 loggerConfiguration = loggerConfiguration . WriteTo . ApplicationInsights (
53- telemetryConfiguration ,
47+ telemetryConfiguration ,
48+ TelemetryConverter . Traces ,
5449 applicationInsightsMinimumLogEventLevel ) ;
55- #pragma warning restore CS0618 // Type or member is obsolete
5650 }
5751
5852 Log . Logger = loggerConfiguration . CreateLogger ( ) ;
0 commit comments