Chad
09/03/2024, 12:02 AMD_Inventor
09/03/2024, 5:58 AMD_Inventor
09/03/2024, 6:04 AMcsharp
services.AddApplicationInsightsTelemetry();
We have these packages installed:
- Serilog.Sinks.ApplicationInsights
- Microsoft.ApplicationInsights.AspNetCore
In our appsettings, we have the following configurations:
json
{
"Serilog": {
"Using": [ "Serilog.Sinks.ApplicationInsights" ],
"WriteTo": [
{
"Name": "ApplicationInsights",
"Args": {
"connectionString": "[value in secrets]",
"telemetryConverter": "Serilog.Sinks.ApplicationInsights.TelemetryConverters.TraceTelemetryConverter, Serilog.Sinks.ApplicationInsights"
}
}
]
},
"ApplicationInsights": {
"ConnectionString": "[value in secrets]"
}
}
That was all that we needed to get it to workD_Inventor
09/03/2024, 6:05 AMJemayn
09/03/2024, 7:23 AMcsharp
services.AddApplicationInsightsTelemetry();
services.ConfigureTelemetryModule<DependencyTrackingTelemetryModule>((module, o) => { module. EnableSqlCommandTextInstrumentation = true; });
Which enables it to log the full sql commands used on db calls - helps a lot with debugging 🙂Chad
09/03/2024, 11:00 PMChad
09/03/2024, 11:10 PMChad
09/03/2024, 11:13 PMChad
09/03/2024, 11:20 PMChad
09/04/2024, 12:08 AM