-
Hello, It seems that since recent versions of dotnet, Activities named Our I am guessing there is some kind of default listener in ASP NET Core. Is it possible to disable them? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hmmm it seems I was wrong, there are no listener by default: But then I wonder why activity is not null |
Beta Was this translation helpful? Give feedback.
-
For anyone using NLog, I had to add: "Logging": {
"LogLevel": {
"Microsoft.AspNetCore.Hosting.Diagnostics": "None"
}
"NLog.Extensions.Logging.NLogLoggerProvider": {
"LogLevel": {
"Microsoft.AspNetCore.Hosting.Diagnostics": "None"
}
}
} Specifically, I had to include the provider name to override the log levels from my nlog.config |
Beta Was this translation helpful? Give feedback.
Ok I found out, I had to disable a logging source (weird to me that has an impact on tracing, but anyway..).
Here is the place in code where this activity is created despite having no listeners on that source:
aspnetcore/src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs
Lines 416 to 418 in 6b7a6a9
In
appsettings.json
:This was answered in this issue: #18955.
I didn't need the
EventLog
section in my case.