Changed AppInsights

This commit is contained in:
Brett Hewitson 2023-03-07 22:44:36 +10:00
parent 0c8c1b3191
commit 23fbd1f43a
4 changed files with 11 additions and 2 deletions

View file

@ -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<Startup>();
})
.ConfigureLogging((hostingContext, options) =>
{
options.AddApplicationInsights();
});
}

View file

@ -16,9 +16,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.ApplicationInsights" Version="2.21.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.3.1" />
</ItemGroup>

View file

@ -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.

View file

@ -4,6 +4,11 @@
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
},
"ApplicationInsights": {
"LogLevel": {
"Default": "Debug"
}
}
},