CorrelationId icon indicating copy to clipboard operation
CorrelationId copied to clipboard

Request Header

Open steveoh opened this issue 5 years ago • 4 comments

I setup the correlation id with EnforceHeader = false; and IgnoreRequestHeader = true;. T

he warning is still emitted.

(CorrelationId.CorrelationIdMiddleware) No correlation ID was found in the request headers

I would think that if these two properties are set up this way then there shouldn't be a need to read the headers at all. Am I misunderstanding the properties?

https://github.com/stevejgordon/CorrelationId/blob/ae77ddcb4abdb7f42d21329b758ad9b4a7b4ba10/src/CorrelationId/CorrelationIdMiddleware.cs#L61-L83

steveoh avatar Jun 22 '20 19:06 steveoh

Thanks for reporting this @steveoh. You are correct, that would make sense and be a small perf gain. Although I doubt it, making this change could be breaking for some users if they for some reason depend on that log message. For now, I'll slate this for a 4.0 release.

In the time being, you could filter out those messages from being logged.

stevejgordon avatar Jun 24 '20 11:06 stevejgordon

How's the 4.0 development going? The log messages are getting rather annoying.

steveoh avatar Sep 23 '20 16:09 steveoh

@steveoh It's been a bit delayed through other commitments. Hoping to carve some time out in the next few months to look at things in a solid block. Did you manage to filter the log messages to reduce the false warnings?

stevejgordon avatar Sep 30 '20 16:09 stevejgordon

I have "CorrelationId": "Information" and I suppose I could turn it up to Warning.

steveoh avatar Sep 30 '20 17:09 steveoh