You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Luedecke, Michael J" <mi...@EDS.COM> on 2006/02/16 16:26:36 UTC

AsyncAppender does not complete

I have associated a FileAppender with an AsyncAppender and a custom
Layout class.  I have noticed that when I attempt to create a log as the
last statement in the application the log never gets added to the file
specified by the FileAppender.  Upon further investigation I have
determined that the termination of the application causes the
AsyncAppender thread to terminate without completing.

Admittedly, there is a little extra overhead attributed with the Layout
class, but not too much.  If I have the application sleep for 1 second
after the log is created and before the end of the application the log
gets written to the file with no problems.

This seems elementary, but I'm unable to figure out how to ensure the
AsyncAppender thread completes before the application is allowed to
fully terminate.  Am I missing something obvious here?

I appreciate any assistance you can provide.

Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org