[logback-user] Stopping LoggerContext while using AsyncAppender

Paresh Pareshpatnaik.mailbox at gmail.com
Wed Jun 25 07:01:08 CEST 2014



I am trying to use AsyncAppender in a standalone application which 
currently uses RollingFileAppender.

AsyncAppender documentation mentions that ,

Upon application shutdown or redeploy, AsyncAppender must be stopped in 
order to stop and reclaim the worker thread and to flush the logging 
events from the queue. This can be achieved by stopping the LoggerContext 
which will close all appenders, including any AsyncAppender instances.


At the time of stoping the application, we use 'kill' command.
Had it been a web application, i could have written code to stop the 
LoggerContext from within contextDestroyed() of ServletContextListener.

So,i would like to know,

1. Is it necessary to stop the LoggerContext while using AsyncAppender.
2. Wont stopping the application, stop the worker thread and flush logging 
events in queue
3. Any other way it can be performed.



More information about the Logback-user mailing list