Bug 38982 - Add non-blocking option for AsyncAppender.
Summary: Add non-blocking option for AsyncAppender.
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Appender (show other bugs)
Version: 1.3alpha
Hardware: Other other
: P2 enhancement
Target Milestone: ---
Assignee: log4j-dev
Depends on:
Reported: 2006-03-15 15:55 UTC by Curt Arnold
Modified: 2006-05-19 13:02 UTC (History)
0 users

Patches to log4j 1.3 AsyncAppender to use with log4j 1.2 (2.17 KB, patch)
2006-03-16 06:04 UTC, Curt Arnold
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Curt Arnold 2006-03-15 15:55:29 UTC
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
Comment 1 Curt Arnold 2006-03-16 05:34:48 UTC
Committed rework of AsyncAppender in rev 386266.
Comment 2 Curt Arnold 2006-03-16 06:04:12 UTC
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
> AsyncAppender.java
patch -p 5 -i AsyncAppender.patch

and build as normal.
Comment 3 Curt Arnold 2006-05-19 20:02:24 UTC
Committed new AsyncAppender to log4j 1.2 branch in rev 407896.