Replies: 1 comment
-
@DaleP309 The staleness check is applied periodically for all sub-appenders and not just the sub-appender being written to. In other words, it is enough for a single log event to be logged for all stale sub-appenders to be closed. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The appenders in Logback are only cleaned up during an append action. Meaning appenders can be existing (and therefore using a file lock) indefinitely if the application does not log another event. And as far as I can tell, there is no way to trigger the appender cleanup process. You could periodically write to a file, but that file is unnecessary and just creates garbage logging. Is there a way to cleanup lingering appenders?
I do see the
FINALIZE_SESSION
marker, however it is unclear when an application has stopped logging. And setting this marker after every append is inefficient and could cause trashing. So the marker isn't really helpful.Any ideas here?
https://github.com/qos-ch/logback/blob/master/logback-core/src/main/java/ch/qos/logback/core/sift/SiftingAppenderBase.java#L121
https://logback.qos.ch/manual/appenders.html#siftGettingTimeoutRight
Beta Was this translation helpful? Give feedback.
All reactions