fix(logging): 🐛 try Active TelemetryConfig to fix logging to AppInsights

This commit is contained in:
Collin M. Barrett 2020-09-25 17:46:19 -05:00
parent 3e1de9b164
commit 210cfde07e

View file

@ -17,7 +17,9 @@ public static async Task TryRunWithLoggingAsync(this IHost host, Func<Task>? run
.WriteTo.Conditional(
_ => host.Services.GetService<IHostEnvironment>().IsProduction(),
c => c.ApplicationInsights(
host.Services.GetRequiredService<TelemetryConfiguration>(),
#pragma warning disable CS0618
TelemetryConfiguration.Active,
#pragma warning restore CS0618
TelemetryConverter.Traces))
.CreateLogger();