Issue Type: Bug Bug
Affects Versions: 1.1.3
Assignee: Logback dev list
Components: logback-classic
Created: 30/Oct/15 5:27 AM
Description:

When a JMS appender is stopping, it only closes its JMS connection if started equals true. See link below
https://github.com/qos-ch/logback/blob/master/logback-classic/src/main/java/ch/qos/logback/classic/net/JMSTopicAppender.java#L140
https://github.com/qos-ch/logback/blob/master/logback-classic/src/main/java/ch/qos/logback/classic/net/JMSQueueAppender.java#L140

However, in the appender start method, if anything goes wrong after the JMS connection is created (in my case, failed to lookup a topic from JNDI), then the appender, which already has a JMS connection, will not be started. When the appender stops, the JMS connection will not be closed.

A JMS connection, once created, even if not started, may have resources (e.g. thread, thread pool, socket connection) allocated to it. Therefore, if not closed correctly, will cause resource leak.

Environment:

Tomcat 7.0.35
ActiveMQ 5.10.0

Project: logback
Labels: JMSQueueAppender JMSTopicAppender Resource Leak
Priority: Minor Minor
Reporter: Wei Cai
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira