You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Ly...@chase.com on 2001/10/23 16:36:18 UTC

log4j and threading

Hi

We are introducing log4j into an existing application. Currently this
application is multithreaded, and it is designed so that the debug-level
logging for each thread is written to a separate in-memory buffer. That is,
each thread has its own buffer. If an exception is thrown in a thread, the
contents of the buffer for that thread are printed out to the console. The
point of this is to reduce the number of messages that are written to the
console; and by using one buffer per thread, reduce the I/O blocking.

Using log4j, I know that you can write to a buffer using the WriterAppender
class, but I am not sure how I can do the 'one buffer per thread' part. If
anyone has any bright ideas I would be glad to hear them.

Many thanks
Lyndsey


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


RE: log4j and threading

Posted by Thomas Tuft Muller <tt...@online.no>.
org.apache.log4j.AsyncAppender is your friend.

--

Thomas



| -----Original Message-----
| From: Lyndsey.J.Hairsine@chase.com [mailto:Lyndsey.J.Hairsine@chase.com]
| Sent: 23 October 2001 15:36
| To: LOG4J Users Mailing List
| Subject: log4j and threading
|
|
| Hi
|
| We are introducing log4j into an existing application. Currently this
| application is multithreaded, and it is designed so that the debug-level
| logging for each thread is written to a separate in-memory
| buffer. That is,
| each thread has its own buffer. If an exception is thrown in a thread, the
| contents of the buffer for that thread are printed out to the console. The
| point of this is to reduce the number of messages that are written to the
| console; and by using one buffer per thread, reduce the I/O blocking.
|
| Using log4j, I know that you can write to a buffer using the
| WriterAppender
| class, but I am not sure how I can do the 'one buffer per thread' part. If
| anyone has any bright ideas I would be glad to hear them.
|
| Many thanks
| Lyndsey
|
|
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
| For additional commands, e-mail: log4j-user-help@jakarta.apache.org
|
|



*************************************************************************
Copyright ERA Technology Ltd. 2001. (www.era.co.uk). All rights reserved. 
Confidential. No liability whatsoever is accepted for any loss or damage 
suffered as a result of accessing this message or any attachments.

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