Skip to content

Commit c6a37eb

Browse files
committed
add application insights
1 parent cf86321 commit c6a37eb

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

WMS.WebUI/WMS.WebUI/Program.cs

+11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using Azure.Identity;
2+
using Microsoft.ApplicationInsights.Extensibility;
23
using Microsoft.AspNetCore.Authentication.JwtBearer;
34
using Microsoft.IdentityModel.Tokens;
5+
using Serilog;
46
using WMS.WebUI.Extensions;
57
using WMS.WebUI.Filters;
68
using WMS.WebUI.Services;
@@ -68,6 +70,15 @@
6870
builder.Configuration.AddAzureKeyVault(
6971
new Uri("https://wms-webui-configurations.vault.azure.net/"),
7072
new DefaultAzureCredential());
73+
74+
builder.Host.UseSerilog((context, configuration) => configuration
75+
.MinimumLevel.Debug()
76+
.WriteTo.ApplicationInsights(
77+
new TelemetryConfiguration
78+
{
79+
InstrumentationKey = "99999930-e6b4-46ed-95cb-73ef51449b94"
80+
},
81+
TelemetryConverter.Traces));
7182
}
7283

7384
app.UseHttpsRedirection();

WMS.WebUI/WMS.WebUI/WMS.WebUI.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<PackageReference Include="Azure.Identity" Version="1.12.0" />
1212
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.7" />
1313
<PackageReference Include="Serilog" Version="4.0.1" />
14+
<PackageReference Include="Serilog.AspNetCore" Version="8.0.2" />
1415
<PackageReference Include="Serilog.Sinks.ApplicationInsights" Version="4.0.0" />
1516
<PackageReference Include="Syncfusion.EJ2.AspNet.Core" Version="26.1.40" />
1617
<PackageReference Include="Syncfusion.Licensing" Version="26.1.40" />

0 commit comments

Comments
 (0)