You can sort your output based on whatever you pushed onto your NDC.  For
example, you could insert some characters between each of the pieces of
information that you are logging (to delineate the information), for example
the ~ character.  Then, open the file in some program that can sort, for
example Microsoft Excel.  Next, sort your output.

> -----Original Message-----
> From: Andrew B [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, October 15, 2001 11:06 AM
> To:   [EMAIL PROTECTED]
> Subject:      using log4j in multithreaded environment
> 
> Hi,
> 
> Is there an appender that allows all the output from
> each thread to be grouped together? I have a
> multithreaded web server environment (Tomcat), as do
> many of you I suspect, and would like to use log4j
> server-side. The manual discusses multithreading, and
> suggests not using a category for each thread, but
> using the NDC instead with the thread ID.
> 
> However, this won't produce the result I am looking
> for: the ability to have the output from each thread
> grouped together instead of interleaved with that of
> other threads. For example, assuming concurrent
> threads:
> 
> Normal output:
> Thread-1: start request
> Thread-2: start request
> Thread-1: end request
> Thread-2: end  request
> 
> Desired output:
> Thread-1: start request
> Thread-1: end request
> Thread-2: start request
> Thread-2:  request
> 
> I realise that to do this you would somehow have to
> tell it to start buffering at the start of the request
> and flush at the end. Would subclassing an appender
> work? Is there already an appender for this?
> 
> Thanks,
> 
> Andrew Broderick
> 
> 
> 
> =====
> The geek shall inherit the earth.
> 
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com
> 
> ---------------------------------------------------------------------
> 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