Summary: | Incorrect use of wait() in AsyncAppender.append() can result in lost events | ||
---|---|---|---|
Product: | Log4j - Now in Jira | Reporter: | Aaron Greenhouse <aarong> |
Component: | Appender | Assignee: | log4j-dev <log4j-dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P1 | ||
Version: | 1.1beta | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: | Program that creates the described error (skipped events) |
Description
Aaron Greenhouse
2001-04-25 08:46:34 UTC
Created attachment 127 [details]
Program that creates the described error (skipped events)
Aaron, The AsyncAppender is not supposed to be interrupted, so why are you trying to interrupt it? With you test program I get plenty of lines of the form: log4j:ERROR AsyncAppender cannot be interrupted. java.lang.InterruptedException at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at org.apache.log4j.AsyncAppender.append(AsyncAppender.java:110) at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251) at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders (AppenderAttachableImpl.java:57) at org.apache.log4j.Category.callAppenders(Category.java:253) at org.apache.log4j.Category.forcedLog(Category.java:443) at org.apache.log4j.Category.info(Category.java:691) at SkipEvent.main(SkipEvent.java:51) The AsyncAppender does not support thread interruption. What's wrong with that? What am I missing? Thanks, Ceki My mistake. You are interrupting your own thread. That is your prerogative and log4j should support it. Ceki |