You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Alan Simpson <si...@hotmail.com> on 2002/06/20 10:13:18 UTC
a bug?? -- problems closing asynchronous appenders
hi,
hi,
I have an Appender class attached to an AsyncAppender. I try to close the
attached appender by calling close() on the AsyncAppender object.
However, this does not work. Looking at the AsyncAppender source code, it
doesn't look as though it calls close() on the attached appenders.
I can close the attached appender by calling
AsyncAppender.removeAllAppenders(), but the problem with this is that the
close() is then executed in the main thread, not in a separate thread.
Is this a bug in the AsyncAppender code (I find this hard to believe)?
Is there a design reason for this behaviour of AsyncAppender.close()?
In any case, is there a way to get my appender to close in a separate
thread?
thanks for your help,
Alan
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: a bug?? -- problems closing asynchronous appenders
Posted by Ceki Gülcü <ce...@qos.ch>.
Alan,
Sorry for not replying to your earlier message. 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.)
Thank you.
At 08:13 20.06.2002 +0000, Alan Simpson wrote:
>hi,
>
>hi,
>
>I have an Appender class attached to an AsyncAppender. I try to close the
>attached appender by calling close() on the AsyncAppender object.
>
>However, this does not work. Looking at the AsyncAppender source code, it
>doesn't look as though it calls close() on the attached appenders.
>
>I can close the attached appender by calling
>AsyncAppender.removeAllAppenders(), but the problem with this is that the
>close() is then executed in the main thread, not in a separate thread.
>
>Is this a bug in the AsyncAppender code (I find this hard to believe)?
>
>Is there a design reason for this behaviour of AsyncAppender.close()?
>
>In any case, is there a way to get my appender to close in a separate
>thread?
>
>thanks for your help,
>
>Alan
--
Ceki
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>