kamon-io / kamon-logback

12 stars 17 forks source link

allow to set different keys to mdc #12

Closed yarosman closed 6 years ago

yarosman commented 6 years ago

Now we can set to MDC only traceID, spanID

      MDC.put(AsyncAppenderInstrumentation.mdcTraceKey, span.context().traceID.string)
      MDC.put(AsyncAppenderInstrumentation.mdcSpanKey, span.context().spanID.string)

But if you want to see in logs userId, userIp, you can not do it. This pull request allows to define Kamon.context keys which will set to MDC too

sebigavril commented 6 years ago

@yarosman nice PR, something that I need as well. If you would grant me permission in this branch, i could writes some specs for this.

@ivantopo, @dpsoft what do you guys think of this?

yarosman commented 6 years ago

@sebigavril I grant you permissions to push

sebigavril commented 6 years ago

@yarosman thanks - i've added the tests

ivantopo commented 6 years ago

Hey @yarosman @sebigavril, this looks good to me, thanks a lot for the contribution! Only pending thing would be for @yarosman to electronically sign the CLA and we can merge and publish this :tada:

yarosman commented 6 years ago

@sebigavril What do you say about possibility to logging also local keys ?

sebigavril commented 6 years ago

@yarosman Yeah, i think that would make sense. Will see if i can find some time to do it. Did you manage to sign the CLA?

yarosman commented 6 years ago

I agreed with CLA

sebigavril commented 6 years ago

@ivantopo @dpsoft some more improvements since you last had a look. Can you please review again?

dpsoft commented 6 years ago

@yarosman @sebigavril done!! Thanks for proposing this PR!!

https://github.com/kamon-io/kamon-logback/releases/tag/v1.0.3