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:[EMAIL PROTECTED] 
Sent: Thursday, July 15, 2004 8:37 AM
To: [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to