logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glenn Strickland" <gstrickl...@kmobjects.com>
Subject RE: One file for every thread
Date Thu, 15 Jul 2004 12:51:54 GMT
I think the suggested way of dealing with a multi-threaded server is not
to log each threads output to a separate file, but to tag each log
record with an identifier unique to that thread, then log them to the
same file. You can do this easily with either NDC (Nested Diagnostic
Context) or MDC (Mapped Diagnostic Context). Details are found in the
short manual (http://logging.apache.org/log4j/docs/manual.html) or in
Ceki Gülcü's excellent book, "log4j, the complete manual." 

Glenn Strickland
Knowledge Management Objects


-----Original Message-----
From: DE BENEDICTIS DAVIDE [mailto:ddebenedictis@sogei.it] 
Sent: Thursday, July 15, 2004 8:37 AM
To: log4j-user@logging.apache.org
Subject: One file for every thread


Hi,
I'm logging a server app with a thread pool in which every worker
instance perform the same task.
How can I log every thread activity in a separate file?
I set explicity thread's name and I have a different logger for every
thread name. But now the problem is logging per thread from all classes
called by originating thread. Is there a log4j feature which permits to
mantain all logging inside a thread context?.

Thank you in advance

--
Davide

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message