-
1. JBoss 6 logging and MDC
chris.jansen Feb 15, 2011 7:24 AM (in response to chris.jansen)Solved - I was using org.jboss.logging.MDC, where I should have been using org.jboss.logmanager.MDC to make the MDC entries appear.
-
2. JBoss 6 logging and MDC
jaikiran Feb 15, 2011 7:30 AM (in response to chris.jansen)Chris, would you mind creating a wiki article to explain the configs that you used to get this working in AS6? There's not much user examples around jboss-logging for AS6, so any info like this is going to help other users.
-
3. JBoss 6 logging and MDC
chris.jansen Feb 15, 2011 9:14 AM (in response to jaikiran)Hi Jaikiran,
How would you like the wiki entry to be written, would you like some example code and show some sample jboss-logging.xml configuration that will work with the code?
Regards,
Chris
-
4. JBoss 6 logging and MDC
jaikiran Feb 15, 2011 9:20 AM (in response to chris.jansen)Chris Jansen wrote:
would you like some example code and show some sample jboss-logging.xml configuration that will work with the code?
Yes, that would be great!
-
5. JBoss 6 logging and MDC
chris.jansen Feb 15, 2011 10:41 AM (in response to jaikiran)It appears that org.jboss.logging.MDC works also, where I was seeing the problem was where I was using org.apache.log4j.MDC. So either org.jboss.logging.MDC or org.jboss.logmanager.MDC will work in place of org.apache.log4j.MDC.
-
6. JBoss 6 logging and MDC
chris.jansen Feb 15, 2011 12:35 PM (in response to chris.jansen)Hi Jaikiran,
Here is the wiki article as requested, is it OK? http://community.jboss.org/wiki/UsingMDCinJBossapplications
Regards,
Chris
-
7. Re: JBoss 6 logging and MDC
jaikiran Feb 15, 2011 1:15 PM (in response to chris.jansen)Excellent! Thanks for creating it. I've linked it to our JBoss AS6 FAQ http://community.jboss.org/wiki/JBossAS6FAQ
-
8. JBoss 6 logging and MDC
chris.jansen Feb 15, 2011 2:25 PM (in response to jaikiran)No problem, I'm glad i could help out!
-
9. JBoss 6 logging and MDC
nickarls May 10, 2011 6:44 AM (in response to chris.jansen)I'm having trouble with MDCs in my custom log4j appender. I got MDC working in general by upgrading log4j to .16 and after that I can access %X{foo} fine in my console appender but the same event being logged to my custom appender ends up with a loggingEvent.getMDC("foo") as null. Any theories?
-
10. JBoss 6 logging and MDC
chris.jansen May 10, 2011 6:59 AM (in response to nickarls)It's possibly due to an incompatibility between JBoss logging on log4j (which is why the log4j MDC didn't work from me). The issue https://issues.jboss.org/browse/JBLOGGING-54 is still open fore this reason. It may be worth dropping a comment on there to see if the problem you are having is the same issue.
-
11. JBoss 6 logging and MDC
nickarls May 10, 2011 7:05 AM (in response to chris.jansen)Thanks for the info, I updated the JIRA. It appears as the event.getMDC() isn't connected to the jboss MDC properly since I can use MDC.get() but not event.getMDC().get()...
-
12. Re: JBoss 6 logging and MDC
markknowles Dec 7, 2011 2:17 PM (in response to chris.jansen)https://issues.jboss.org/browse/JBLOGGING-54 indicates that this issue was fixed in Jboss Logging 3.0.0.GA . However, I still see this issue in 3.0.1.GA. (I am using jboss-as-web-7.0.2.Final, which contains modules\org\jboss\logging\main\jboss-logging-3.0.1.GA.jar). The workaround (use org.jboss.logging.MDC) works fine.