Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
-
Bug is also in the GIT head revision.
Description
In ch.qos.logback.core.rolling, both TimeBasedRollingPolicy and TimeBasedFileNamingAndTriggeringPolicy support the LifeCycle interface, and the former aggregates the latter.
What TimeBasedRollingPolicy fails to do is to delegate the stop() event to its timeBasedFileNamingAndTriggeringPolicy object (it actually has no own stop() currently). This causes resource management problems in my use case, because my stop() is never called.
Fix: Add this to ./logback-core/src/main/java/ch/qos/logback/core/rolling/TimeBasedRollingPolicy.java
/** * {@inheritDoc} */ @Override public void stop() { if (timeBasedFileNamingAndTriggeringPolicy != null) { timeBasedFileNamingAndTriggeringPolicy.stop(); } super.stop(); }