-
Notifications
You must be signed in to change notification settings - Fork 38
WithCorrelationIdHeader seems to keep creating new Guid #31
Comments
Not 100% if this fixes the issue without breaking other logic within the extension but I added the following code in the CorrelationIdHeaderEnricher and it seems to work.
The method used is similar to GetCorrelationId from CorrelationIdEnricher class
and of course Please let me know if this is acceptable, or if other problems could arise if this change (or something similar) takes place. |
Getting correlationId from response header to avoid creating it again in CorrelationIdHeaderEnricher
https://github.com/ekmsystems/serilog-enrichers-correlation-id/pull/33/files#diff-e4f3e565f0c3341e91e28b282cd1925eR51 |
added unit test for reusing the same correlationId for multiple log entries
added unit test for reusing the same correlationId for multiple log entries for second enricher
Merged #33 which should fix this. Thanks @lkurzyniec. 👍 |
Released as v3.0.1 so I'm gonna close this one off. Feel free to reopen if there are any issues. 👍 |
Hi, it seems that if no header is found in WithCorrelationIdHeader() then a new Guid is being created (which is correct), but for each log event it seems that it creates a new one every time, resulting in a no correlation between the event logs.
Unless I misunderstood something in the documentation, shouldn't the fallback functionality work as WithCorrelationId() method if no header is found? That is to create a new correlation id and keep that id the same for all event logs?
The text was updated successfully, but these errors were encountered: