[logback-user] TimeBasedRollingPolicy not removing all old files

Oddoy, Manuel (KVB - München) Manuel.Oddoy at kvb.de
Mon Apr 12 14:59:43 CEST 2021


Hello logback community,

I stumbled over following situation with the TimeBasedRollingPolicy:
-       I have a short running application with following appender configuration
        <appender name="R" class="ch.qos.logback.core.rolling.RollingFileAppender">
          <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>logfiles.%d{yyyy-MM-dd}.log</fileNamePattern>
            <maxHistory>9</maxHistory>
          </rollingPolicy>
      [some other config]
        </appender>
-       The log rotation never occured as the application is only short-running and never over midnight. I had missed adding the <cleanHistoryOnStart>true</cleanHistoryOnStart> to the configuration - would probably worth a bit more documentation as this clean flag is described last and therefore could easily be missed on http://logback.qos.ch/manual/appenders.html
-       Now I already have a lot of logfiles in my directory and the TimeBasedArchiveRemover seems only to remove one file - Is this intended and why?

Regards
Manuel Oddoy

Disclaimer:
Bitte beachten Sie: die obige Mitteilung ist ausschließlich für die in den
Adresszeilen benannten Personen bestimmt und enthält möglicherweise
vertrauliche Informationen. Sollten Sie diese Nachricht fälschlicherweise
erhalten haben, informieren Sie bitte den Absender. Bitte löschen Sie
die Nachricht und sehen Sie davon ab, die Inhalte zu nutzen,
aufzubewahren, weiterzuleiten oder zu reproduzieren.

Virenschutz:
Unser Unternehmen verfügt über eine funktionierende Anti-Viren-
Software und prüft jede abgesendete E-Mail und deren Anhänge auf
Viren. Trotzdem können wir nicht garantieren, dass die E-Mail virenfrei
ist und übernehmen keine Haftung für Schäden, die aus Viren entstehen.

Hinweis zum Datenschutz:
Die Informationen nach Art. 13 und 14 DSGVO finden Sie unter
"www.kvb.de/datenschutz"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20210412/6c929c46/attachment.html>


More information about the logback-user mailing list