[logback-dev] [JIRA] Updates for LOGBACK-1556: SizeAndTimeBasedRollingPolicy does not delete old files with MaxHistory
QOS.CH (JIRA)
noreply-jira at qos.ch
Thu May 13 09:18:00 CEST 2021
logback / LOGBACK-1556 [Open]
SizeAndTimeBasedRollingPolicy does not delete old files with MaxHistory
==============================
Here's what changed in this issue in the last few minutes.
This issue has been created
This issue is now assigned to you.
View or comment on issue using this link
https://jira.qos.ch/browse/LOGBACK-1556
==============================
Issue created
------------------------------
David Goichman created this issue on 13/May/21 9:05 AM
Summary: SizeAndTimeBasedRollingPolicy does not delete old files with MaxHistory
Issue Type: Bug
Affects Versions: 1.3.0-alpha5
Assignee: Logback dev list
Attachments: image-2021-05-13-10-02-35-819.png
Components: logback-core
Created: 13/May/21 9:05 AM
Environment:
<appender name="FILE"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>TRACE</level>
</filter>
<rollingPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOG_HOME}/%d\{yyyyMMdd}_agent_%i.log
</fileNamePattern>
<maxFileSize>16MB</maxFileSize>
<maxHistory>1</maxHistory>
<totalSizeCap>1GB</totalSizeCap>
<historyAsFileCount>true</historyAsFileCount>
<cleanHistoryOnStart>true</cleanHistoryOnStart>
</rollingPolicy>
<encoder>
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
Labels: SizeAndTimeBasedRollingPolicy rollingFileappender
Priority: Major
Reporter: David Goichman
Description:
The policy will not delete files older than a month, and shows other inconsistent behavior.
e.g. 20210429_agent_0.log will never be deleted.
!image-2021-05-13-10-02-35-819.png! It will also sometimes not remove any files at all, as you can see from the rest of the logs from May <-> 05.
To reproduce you can use the same policy as in the environment, and just copy and paste the same file as in the format with a date that goes a month or more back, they will not be removed.
==============================
This message was sent by Atlassian Jira (v8.8.0#808000-sha1:e2c7e59)
More information about the logback-dev
mailing list