Does your log4j2.xml also define an AsyncAppender? 

(Btw, what is a lakh?)

Sent from my iPhone

On 2013/07/19, at 0:31, Sudharma Puranik <[email protected]> wrote:

> I have a log4j2.xml configuration file from which I am getting the Logger, 
> attached is the snapshot. when my logger is created a new thread is created.
> 
> Programmatically,I create a RollingFileAppender and attach the same to 
> AsyncAppender . I attach the Async Appender to the configuration of the 
> log4j.xml, And when I start the Async Appender again a new thread is created.
> 
> The problem now is that both the threads are writing to my async appender so 
> for a 5 lakh line log, I get 10 lakh lines because each thread is writing the 
> log.
> 
> Is this a bug? because I get a logger a new thread is generated and when I 
> create a async appender another thread is created and both are doing the same 
> job.
> 
> -Sudharma
> <asyncAppendThread.png>
> <loggerThread.png>
> 
> ---------------------------------------------------------------------
> 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