logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gulcu <c...@qos.ch>
Subject Re: log4j v1.2.14 compatible with Java 1.6?
Date Thu, 18 Jun 2009 09:26:02 GMT

Hi Lesley,

Looking at your log4j.xml file it appears that you are defining several 
AsyncAppenders, actually 6 of them which does not explain why there are 12 
AsyncAppender threads. At some point in time, you have probably restarted the 
web-application (or reloaded log4j) without shutting down log4j. When you stop 
and restart your application make sure to invoke LogManager.shutdown().

Best regards,

Lesley Tay wrote:
> Hi Ceki / all,
> Since then I've done abit more investigation and found a few odd things 
> which support the theory that there is more than 1 thread writing 
> to the same log file thus causing our log file to get corrupted and have missing entries.
> I noticed that:
> * a thread dump via Weblogic 10.3 is showing that when we deploy our app, there are 12
> threads that are active in just 1 weblogic server JVM (threads look like the below):
>             "Dispatcher-Thread-37" waiting for lock java.util.ArrayList@1f608cc WAITING
>             	java.lang.Object.wait(Native Method)
>             	java.lang.Object.wait(Object.java:485)
>             	org.apache.log4j.AsyncAppender$Dispatcher.run(AsyncAppender.java:540)
>             	java.lang.Thread.run(Thread.java:619)
> * there are also 2 unix file descriptors open on each of the log files that are getting
> All the file descriptors come from the 1 java process for the Weblogic server jvm above

> (Again supports the 2 threads writing to the same physical file theory).
> I'm planning to debug our app locally to see what's creating the extra AsyncAppender
> Is someone able to tell me how many AsyncAppender threads we should expect to get spawned
> given our log4j.xml config file. I've attached this to the email as a text file.
> I'm thinking there should be 6 AsyncAppender threads since we define 6 AsyncAppenders.
> Is that right?
> Thanks,
> Lesley

Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.

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

View raw message