From 23fbd1f43ada1fead6af863a579b3bb3279df83f Mon Sep 17 00:00:00 2001 From: Brett Hewitson Date: Tue, 7 Mar 2023 22:44:36 +1000 Subject: [PATCH] Changed AppInsights --- src/ServerManager.WebApplication/Program.cs | 5 +++++ .../ServerManager.WebApplication.csproj | 2 +- src/ServerManager.WebApplication/Startup.cs | 1 - .../appsettings.Development.json | 5 +++++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ServerManager.WebApplication/Program.cs b/src/ServerManager.WebApplication/Program.cs index 987d9163..ef02bb9f 100644 --- a/src/ServerManager.WebApplication/Program.cs +++ b/src/ServerManager.WebApplication/Program.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; namespace ServerManager.WebApplication; @@ -15,5 +16,9 @@ public class Program .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup(); + }) + .ConfigureLogging((hostingContext, options) => + { + options.AddApplicationInsights(); }); } diff --git a/src/ServerManager.WebApplication/ServerManager.WebApplication.csproj b/src/ServerManager.WebApplication/ServerManager.WebApplication.csproj index e6e58b0e..47db490b 100644 --- a/src/ServerManager.WebApplication/ServerManager.WebApplication.csproj +++ b/src/ServerManager.WebApplication/ServerManager.WebApplication.csproj @@ -16,9 +16,9 @@ - + diff --git a/src/ServerManager.WebApplication/Startup.cs b/src/ServerManager.WebApplication/Startup.cs index cba8a988..cf7cf016 100644 --- a/src/ServerManager.WebApplication/Startup.cs +++ b/src/ServerManager.WebApplication/Startup.cs @@ -57,7 +57,6 @@ public class Startup }); services.AddHealthChecks(); - services.AddApplicationInsightsTelemetry(Configuration); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. diff --git a/src/ServerManager.WebApplication/appsettings.Development.json b/src/ServerManager.WebApplication/appsettings.Development.json index 8fd58787..674f186f 100644 --- a/src/ServerManager.WebApplication/appsettings.Development.json +++ b/src/ServerManager.WebApplication/appsettings.Development.json @@ -4,6 +4,11 @@ "Default": "Information", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" + }, + "ApplicationInsights": { + "LogLevel": { + "Default": "Debug" + } } },