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 AsyncAppender threads that are active in just 1 weblogic server JVM (threads look like the below):

            "Dispatcher-Thread-37" waiting for lock java.util.arrayl...@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 corrupted. 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 threads.
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.
http://logback.qos.ch

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

Reply via email to