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" + } } },