[logback-dev] [JIRA] Commented: (LBSITE-14) Add documentation how to shutdown Logback in a web application
Syvalta (JIRA)
noreply-jira at qos.ch
Wed Jun 4 11:58:11 CEST 2008
[ http://jira.qos.ch/browse/LBSITE-14?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10580#action_10580 ]
Syvalta commented on LBSITE-14:
-------------------------------
Possible FAQ entry, edited from solution posted by Anton Tagunov:
How to shutdown Logback in web application?
This solution applies, when slf4j and logback jars
* are provided by the web application itself
* not provided as shared jars by the Servlet container
In this particular case you can write a ServletContextListener
that will do the following in contextDestroyed():
public void contextDestroyed(ServletContextEvent servletContextEvent) {
((LoggerContext)LoggerFactory.getILoggerFactory()).shutdownAndReset()
}
You will also need to register this context listener in web.xml
<listener>
<listener-class>your.servlet.context.Listener</listener-class>
</listener>
> Add documentation how to shutdown Logback in a web application
> --------------------------------------------------------------
>
> Key: LBSITE-14
> URL: http://jira.qos.ch/browse/LBSITE-14
> Project: logback-site
> Issue Type: Improvement
> Components: Documentation
> Reporter: Syvalta
> Assignee: Logback dev list
>
> Currently it is not documented how to shutdown Logback in a web application.
> For more details, see: http://www.nabble.com/log-files-locked-after-application-undeploy-td17619508.html
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the logback-dev
mailing list