-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Support optional/nullable values for MDC #172
Comments
what kind of api did you have in mind? |
My suggestion would be a very simple |
It was so easy that I went ahead and opened a PR. Hope you don't mind :) |
`withLoggingContext` now accepts nullable values that won't be written to the `MDC` (and thus also don't overwrite existing values). This might be useful if some values are not guaranteed to exist, but you want them in the `MDC` if possible. Issue: #172
Released in 2.0.7. Thanks again! |
Quick question: I can't find a 2.0.7 release. Did I misunderstand you? |
I think it's because jcenter is not working anymore because the build was working: https://travis-ci.org/github/MicroUtils/kotlin-logging/jobs/761498773 I'll have to move to use maven central directly and only then publish again. |
Ah, thank you and good luck! 🙂 |
I'd like to add a value to the
MDC
if it exists. With the current implementation, I have to manually check this before I can callwithLoggingContext
. However, I'd like to pass a nullable argument that is only added toMDC
if it's not null.If you're interested, I would also try to write a PR.
The text was updated successfully, but these errors were encountered: