Bug 10185

Summary: AsyncAppender.close() does not call close() on attached appenders
Product: Log4j - Now in Jira Reporter: Paul Voutier <pvoutier>
Component: AppenderAssignee: log4j-dev <log4j-dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 1.2   
Target Milestone: ---   
Hardware: Other   
OS: other   

Description Paul Voutier 2002-06-24 17:23:19 UTC
I sent a message to the log4j-dev mailing list, which Ceki replied to.

Here is his reply:

"You are correct to observe that AsyncAppender.close does not close 
embedded appenders. The rationale behind this behavior is that embedded
appenders might be attached somewhere else, so closing them when
AsyncAppender is closed would be somewhat heavy handed and possibly
incorrect.

This "foresightful" reasoning is doubtful because attaching the same
appender to more than one logger is often problematic and consequently
discouraged. It would much simpler if AsyncAppender.close also closed
embedded appenders.  I would appreciate if you could enter a
bug report so that the problem is not forgotten. (I admit its a
problem.)"
Comment 1 Paul Voutier 2002-06-24 17:25:12 UTC
I wrote to the log4j-dev mailingn list the other day and received the following 
reply back from Ceki:

"You are correct to observe that AsyncAppender.close does not close 
embedded appenders. The rationale behind this behavior is that embedded
appenders might be attached somewhere else, so closing them when
AsyncAppender is closed would be somewhat heavy handed and possibly
incorrect.

This "foresightful" reasoning is doubtful because attaching the same
appender to more than one logger is often problematic and consequently
discouraged. It would much simpler if AsyncAppender.close also closed
embedded appenders.  I would appreciate if you could enter a
bug report so that the problem is not forgotten. (I admit its a
problem.)"
Comment 2 Ceki Gulcu 2002-07-05 10:41:50 UTC
Paul,
Thank you for filing a bug report. Fixed in log4j 1.2.5.