-
Notifications
You must be signed in to change notification settings - Fork 123
Duplicate exceptions from Ilogger + RequestTrackingModule #861
Comments
workaround
|
as per this: https://github.com/Microsoft/ApplicationInsights-dotnet-logging/issues/268 please also keep in mind that other middlewares (without much config options) are possibly logging exceptions. EDIT: Doesn't seem the RequestTrackingModule being the issue EDIT 2: Where is this done and how to disable this behavior?
|
Having similar issue when using Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware. |
@alex-zyl following the other thread, seems I have resolved with
I know they worked on adding logging directly into the main app insights package, but we are not using betas in prod so, our config is
|
@alex-zyl If you are using ExceptionHandlerMiddleware, you are right - you'll get duplicate logs. To prevent ai from getting it, apply a filter as shown below. |
Closed with #863 |
When an exception is thrown from Controller, RequestTrackingModule reports it.
https://github.com/Microsoft/ApplicationInsights-aspnetcore/blob/develop/src/Microsoft.ApplicationInsights.AspNetCore/DiagnosticListeners/Implementation/HostingDiagnosticListener.cs#L480
Since ILogger is also enabled by default now, it also captures this exception.
Repro Steps
Actual Behavior
2 exception telemetry, 1 from Ilogger, 1 from request tracking module
Expected Behavior
1
Version Info
SDK Version :
.NET Version :
How Application was onboarded with SDK(VisualStudio/StatusMonitor/Azure Extension) :
OS :
Hosting Info (IIS/Azure WebApps/ etc) :
The text was updated successfully, but these errors were encountered: