logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack, Adam" <Adam.J...@New-Era-of-Networks.com>
Subject NDC mix-up
Date Sat, 08 Dec 2001 17:21:04 GMT
Hi,

Intermittently I am seeing all the NDCs (in theoretically different threads)
in a single log entry. They seem to get mixed-up and all be displayed.

I have the following scenario:

1)	JSP pages & components in a single app server (in single VM)
	
	Log4J configure to use the SocketClient to talk to a single
SocketServer

2)	Log4J SocketServer configured to append to NT Event Log

I do this because (1) I couldn't get the NT Event Log appender to work in
the app server (long painful DLL story) and (2) to centralize things.

Now:

The app server does manage threads (& JSP pages can re-use threads that are
returned to the pool) --- but if it were something like me not cleaning the
NDC stack I'd expect one or two NDCs to get mixed-up, not all. It is all of
them.

I do configure the Log4J sub-system once, in a single thread [not once per
thread], but I get my categories within the thread I am working inside (from
the single instance of Log4J).

To push onto the NDC I do just this --- I am (from my reading) assuming that
the NDC manages a stack as a ThreadLocal object and so long as I do this in
my thread, and pop when my thread dies, then I am using NDC correctly:

                NDC.push( "Yada Yada" );

Questions:

*	Am I mis-understanding NDC usage somehow?
*	Am I doing something obviously wrong in the code?
*	Am I hitting a bug in my combination of appenders (or my
usage/configuration of them)?

Again -- this is intermittent, I can't quite track down what causes it &
when exactly it happens. Any insights appreciated.

regards

Adam
--
Open Business Interchange: <http://www.openbiz.biz>
The Revolutionary B2Bi Web Service ...


--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


Mime
View raw message