-
Notifications
You must be signed in to change notification settings - Fork 8
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
Adapt log4j2.ThreadContext to jboss-logging.MDC #36
Comments
This looks related to https://issues.redhat.com/browse/JBLOGGING-161. The issue is likely that Quarkus is using the jboss-logmanger which binds the |
Not sure - as far as I know Quarkus uses jboss-logging internally, so it's probably totally fine that they use the jboss-logging.MDC. If I get the idea of jboss-logging and for example the log4j2-jboss-logmanager right, it's just some kind of "Log4j2-lookalike frontend" which uses the "jboss-logging backend" for the real logging. Following this idea I'd expect that it shouldn't matter which frontend is used. |
What I meant was that the When the message is logged and the @dmlloyd any specific thoughts on Quarkus here? |
For delegating the |
resolves jboss-logging#36 Signed-off-by: James R. Perkins <[email protected]>
So something like this? #37 It's not quite complete, but just a quick work up. |
I think there is a similar issue with the Log4j2 |
resolves jboss-logging#36 Signed-off-by: James R. Perkins <[email protected]>
resolves jboss-logging#36 Signed-off-by: James R. Perkins <[email protected]>
resolves jboss-logging#36 Signed-off-by: James R. Perkins <[email protected]>
resolves jboss-logging#36 Signed-off-by: James R. Perkins <[email protected]>
resolves jboss-logging#36 Signed-off-by: James R. Perkins <[email protected]>
Currently when using the Log4j2 frontend (log4j2-jboss-logmanager-1.1.1.Final) with the jboss-logging backend and calling
log4j2.ThreadContext.put("foo", "bar")
this invocation is not bridged towards the jboss-logging.MDC.This specifically hits me in combination with Quarkus, reactive-messaging and smallrye-context-propagation, where it looks like only the jboss-logging.MDC is propagated but not the log4j2.ThreadContext.
Additionally I observed that context, that is put to the jboss-logging.MDC, is not rendered when the log message is created with the log4j-API.
I verified this by adding a very naive implementation of a MdcBridge, but this is probably not a candidate for an initial PR because it results in heavy use of MDC.getMap(), which is documented as "expensive and should be used sparingly". Additionally I had to cast the Map<String, Object> to Map<String, String>.
The text was updated successfully, but these errors were encountered: