[logback-dev] [JIRA] Commented: (LBGENERAL-42) Lifecycle stop() method is never called

Ralph Goers (JIRA) noreply-jira at qos.ch
Wed Oct 20 05:31:51 CEST 2010


    [ http://jira.qos.ch/browse/LBGENERAL-42?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11868#action_11868 ] 

Ralph Goers commented on LBGENERAL-42:
--------------------------------------

I happened to notice this as I was writing a routing appender similar to what we discussed in another Jira issue over the weekend. I was surprised to see that LoggerContext doesn't contain the list of configured appenders.  It occurred to me that since appenders are started as they are created that if an appender is never referenced by a logger it will never be stopped. I would imagine this is fairly common since loggers are often commented out and then readded when more log output is desired.  

It also occurred to me that this means that if multiple loggers reference the same appender that the appender will be stopped when the first one stops its appenders even though it is still attached to multiple loggers. The consequence of this is that although logback is threadsafe during a reconfiguration the state of logging is unpredictable during that time.

> Lifecycle stop() method is never called
> ---------------------------------------
>
>                 Key: LBGENERAL-42
>                 URL: http://jira.qos.ch/browse/LBGENERAL-42
>             Project: logback-general
>          Issue Type: Bug
>            Reporter: Lieven Doclo
>            Assignee: Ceki Gulcu
>
> Don't know whether this is intended behavior, but when for example an configuration is loaded, the Lifecycle start() method is called. However, when the VM exits, stop() is never called. So anything in there is never executed. I came across this when writing a Google Charts appender for Perf4J.

-- 
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