Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CorrelationIdMiddleware Logging Question #110

Open
mwasson74 opened this issue Jun 13, 2022 · 1 comment
Open

CorrelationIdMiddleware Logging Question #110

mwasson74 opened this issue Jun 13, 2022 · 1 comment

Comments

@mwasson74
Copy link

Hello,

I've am using your NuGet package and had a question regarding your logging. In CorrelationIdMiddleware Line 147 I am seeing null as the generated CorrelationId in my logs: image

I cloned your repo and had my project reference the clone's dlls instead of the NuGet package and added my own logging line to see if CorrelationId was really null there and it is not.

I realize it's a delegate returned from LoggerMessage.Define() but I don't understand why it prints null in the logs there instead of the actual CorrelationId.

Thanks in advance for helping me understand!!

@mwasson74
Copy link
Author

I noticed something new this morning. When I shutoff/comment-out my Serilog Enricher (screen shot), the CorrelationId logging prints the generated CorrelationId as expected (another screen shot).

Enricher code that can return null:
image

Logging with the Enricher shutoff:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant