Skip to content

Commit

Permalink
fix(logging): 🐛 try Active TelemetryConfig to fix logging to AppInsights
Browse files Browse the repository at this point in the history
  • Loading branch information
collinbarrett committed Sep 25, 2020
1 parent 3e1de9b commit 210cfde
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 210cfde

Please sign in to comment.