This content has been marked as final.
Show 1 reply
-
1. Re: CMP 2.0 Log4J NDC
tbfmicke Feb 26, 2003 1:24 PM (in response to jeff_inns)This happened to me too, and I did some checking.
It seems that everywhere that JBoss code does
a NDC.push()/pop() it also does a NDC.remove().
This feels like a bug and that the NDC.remove() only
should be called when the thread itself is removed.
(Have not gotten around to file a report about it though)
To get around this I used the log4j.MDC instead and
updated the config file to display a MDC.
Ex: log4.xml %X{user} is the MDC
Then I do a
MDC.put("user", userInfo);
at the start of every request in the web layer.
(userinfo is username + remote ip addr btw)
I have not tested this under load yet, but so far the same thread seems to be used all the way down to the EJB layer.
Regards
/Mikael