stevejgordon / CorrelationId

An ASP.NET Core middleware component which synchronises a correlation ID for cross API request logging.
MIT License
559 stars 106 forks source link

Request Header #83

Open steveoh opened 4 years ago

steveoh commented 4 years ago

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

stevejgordon commented 4 years ago

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.

steveoh commented 4 years ago

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

stevejgordon commented 4 years ago

@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?

steveoh commented 4 years ago

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