Why is MarkerLoggingAdapter not thread safe?

i have a few questions regarding a comment on MarkerLoggingAdapter which states that this class is not thread-safe

From my understanding, this class takes the marker as input into the method and copies it onto the LogEvent before publishing it onto the event stream. Therefore it seems to me that it is in fact thread safe (as opposed to DiagnosticMarkerBusLoggingAdapter which uses a local var to hold the MDC). The LogMarker object does have a function named extractFromMDC but it does not seem to be used anywhere. Am I missing something?

thanks in advance

Therefore it seems to me that it is in fact thread safe (as opposed to DiagnosticMarkerBusLoggingAdapter which uses a local var to hold the MDC).

Yeah seems you’re right.

The LogMarker object does have a function named extractFromMDC but it does not seem to be used anywhere. Am I missing something?

Indeed seems to be not used; It is public API though so we should not just remove it.

We could deprecate the method perhaps since we carry the information nowadays in a special field in log events…

Thanks @ktoso for the quick reply!

As for next steps, do you feel like deprecating the “extractFromMDC” method and removing the misleading comment is reasonable? If so, will i be able to submit a PR?

Please first open a ticket about it – such things are best discussed on github.
I’m not sure it is worth removing those warnings from the comments; In general the comment stands about the actor logging utilities. User should be totally fine to use their favourite logger directly etc.