logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: How Asynchronous Appennder works ?
Date Wed, 20 Jul 2005 15:27:22 GMT

On Jul 20, 2005, at 9:03 AM, Jayant Dusane wrote:

> Hi curt
>   i m using the log4cxx-0.9.7 , I hav one doubt ,  If suppose i  
> create two logger in my xml file one Asynchonous Appender for  
> that ,So Asynchonous Appender buffer is one for whole application ,  
> or buffer per logger ? .I checked that only one Dispature thread is  
> started , And Dispature is a member of asynchonous class ie only  
> one instance of asynchonous appender is created , So please expain  
> this.
>  Regards
>     Jayant Dusane
>     Starent Networks India Pvt. Ltd
> Walla! Mail - get your free 3G mail today

There is only one buffer per appender.  When an logging event is  
added to an async appender, the logging thread only needs to be  
blocked for the time that is needed to add the message to the  
buffer.  If the buffer is not full, this should be substantially  
shorter than the time that the thread would be blocked if a  
synchronous were used.  If the buffer is full, the logging thread  
will be blocked until the dispatching thread has opened up some space  
in the buffer. 

View raw message