On Oct 20, 2008, at 8:27 AM, Frank Karlstrom wrote:

We are experiencing deadlocks on our server.

We have tested with log4j version 1.2.8 up to and including 1.2.15

We have identified that cause to be a log statement inside a synchronized block,
which is called from different threads.

We have attached to very simplified classes, to reproduce the deadlock. Our framework is a lot more complex, where log4j can be called indirectly with reflection, not neccessarily by us, but from third party libraries etc.

The deadlock can be reproduced always.

Is our usage (or library usage) of log4j faulty, or is it a bug?


The example provided results in a logging request being made during the toString() method of a message parameter. If you pass an arbitrary object as a message, you have to insure that it does not make any log4j logging requests in the evaluation of toString(). This is a known weakness of log4j 1.x, but can not be addressed outside of a major version change. It is an issue in the log4j 2.0 JIRA which lists requirements and wishes for log4j 2.0 development (https://issues.apache.org/jira/browse/LOG4J2-8 ).




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to