You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I would like to disable or better change the log level of the _missingCorrelationIdHeader log to Debug rather than Information, since not are requests are required to have such header in my application.
INFO - CorrelationId.CorrelationIdMiddleware: "No correlation ID was found in the request headers"
Is there a way to achieve such thing?
Or maybe consider adding it if not?
Regards
The text was updated successfully, but these errors were encountered:
Although I think that it would be handy to have a configuration option to either suppress this message or to choose which loglevel to use for it, I managed to mute it with a log filter in the ConfigureLogging call:
.ConfigureLogging(builder =>{// ... other configs ... builder.AddFilter((category,level)=>!(category.Contains(nameof(CorrelationIdMiddleware), StringComparison.InvariantCultureIgnoreCase)&&level< LogLevel.Error));}
With nameof I try to prevent regressions in case the source code changed (I know, it's weak...) and with the (adjustable) level filter I'm not excluding important logs.
Hello,
I would like to disable or better change the log level of the _missingCorrelationIdHeader log to Debug rather than Information, since not are requests are required to have such header in my application.
INFO - CorrelationId.CorrelationIdMiddleware: "No correlation ID was found in the request headers"
Is there a way to achieve such thing?
Or maybe consider adding it if not?
Regards
The text was updated successfully, but these errors were encountered: