[logback-dev] [JIRA] (LOGBACK-1404) SizeAndTimeBasedRollingPolicy discards log data

QOS.CH (JIRA) noreply-jira at qos.ch
Fri May 25 17:17:00 CEST 2018

Anton Wiedermann created LOGBACK-1404:

             Summary: SizeAndTimeBasedRollingPolicy discards log data
                 Key: LOGBACK-1404
                 URL: https://jira.qos.ch/browse/LOGBACK-1404
             Project: logback
          Issue Type: Bug
          Components: logback-core
    Affects Versions: 1.2.3
         Environment: Windows 10 64bit

            Reporter: Anton Wiedermann
            Assignee: Logback dev list
         Attachments: logback.xml, Rotfail.java

RollingFileAppender when used with SizeAndTimeBasedRollingPolicy disards during log rotation first file that should have been archived. This happens only if file rotates by time before first rotating by date

Attached is app that simply does some info and debug logging and logback config file that logs everything to one file and info to other. Logs rotate at 100kB or after a minute. fast log keeps exceeding file size limit so it is archived properly. slow log does not exceed the file size limit and when minute changes it simply gets deleted and starts fresh. With next minute change it is properly archived though.

Since log rotation is usually set for a day this can mean loss of day worth of logging.

This message was sent by Atlassian JIRA

More information about the logback-dev mailing list