Option to suppress missing correlation id
keerthivasanm opened this issue · comments
Not all requests are API requests. If used in a web app, it really pollutes the log file. An option to ignore this would be nice :)
info: CorrelationId.CorrelationIdMiddleware[106]
No correlation ID was found in the request headers
info: CorrelationId.CorrelationIdMiddleware[106]
No correlation ID was found in the request headers
info: CorrelationId.CorrelationIdMiddleware[106]
No correlation ID was found in the request headers
info: CorrelationId.CorrelationIdMiddleware[106]
No correlation ID was found in the request headers
info: CorrelationId.CorrelationIdMiddleware[106]
No correlation ID was found in the request headers
info: CorrelationId.CorrelationIdMiddleware[106]
No correlation ID was found in the request headers
Possible workaround: Suppress CorrelationId log level but may miss necessary stuff.
Thanks for your input @keerthivasanm.
My suggestion here is to filter the CorrelationId logs in your configuration to Warning, ignoring Information/Trace. I use info during development but it serves little value once deployed. If you require additional logging you can always add your own where you need it. You can also enable AddToLoggingScope
on the options to have the correlation ID stamped onto structured log data as part of the logging scope for the request.
I don't see value is adding a specific configuration to control this when a suitable mechanism(s) exists already.