As discussed in log4j-dev message "Contribution of non-blocking socket appender" on 2006-01-11 (http://marc.theaimsgroup.com/?t=113700495300004&r=1&w=2), it would be desirable to configure AsyncAppender so that logging requests made when the buffer is full do not cause the requesting thread to block. This feature is included in a resubstantial rewriting of AsyncAppender that will follow which hopefully addresses the large number of deadlock reports with the current AsyncAppender. A new configuration "blocking" with a default value of true is added. If set to false, log requests received while the buffer is blocked will be used to update a Map that is used to maintain the highest severity and count of messages for each encountered logger. After the messages in the buffer are output, the map will be used to generate messages like: org.example.foobar ERROR Discarded 15 messages due to full event buffer including: Message from first ERROR on org.example.foobar
Committed rework of AsyncAppender in rev 386266.
Created attachment 17910 [details] Patches to log4j 1.3 AsyncAppender to use with log4j 1.2 To modify a log4j 1.2 build to use the initial reworked appender. cd src/java/org/apache/log4j svn cat http://svn.apache.org/repos/asf/logging/log4j/trunk/src/java/org/apache/log4j/AsyncAppender.java > AsyncAppender.java patch -p 5 -i AsyncAppender.patch and build as normal.
Committed new AsyncAppender to log4j 1.2 branch in rev 407896.