From ff0e668fc6c5ed2d3955d50f97e1bbe107c8805e Mon Sep 17 00:00:00 2001 From: David Fowler Date: Sat, 5 Nov 2022 13:35:05 -0700 Subject: [PATCH] Add azure monitor logging as well --- src/Services/Podcasts/Podcast.MinimalAPI/Program.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Services/Podcasts/Podcast.MinimalAPI/Program.cs b/src/Services/Podcasts/Podcast.MinimalAPI/Program.cs index 97d6b29..1841039 100644 --- a/src/Services/Podcasts/Podcast.MinimalAPI/Program.cs +++ b/src/Services/Podcasts/Podcast.MinimalAPI/Program.cs @@ -100,6 +100,14 @@ builder.Services.AddOpenTelemetryMetrics(metrics => .AddHttpClientInstrumentation(); }); +builder.Logging.AddOpenTelemetry(logging => +{ + logging.AddAzureMonitorLogExporter(o => + { + o.ConnectionString = azureMonitorConnectionString; + }); +}); + var app = builder.Build(); await EnsureDbAsync(app.Services);