Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-904

RollingFile appender doesn't zip and create new files

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.6.2
    • Component/s: Appenders
    • Labels:
      None
    • Environment:

      Windows 7

      Description

      Using TimeBasedTriggeringPolicy, with a filePattern of f:/Log4J/$${date:yyyy-MM}/IIB-%d{MM-dd-yyyy}-%i.log.zip and a fileName of f:/Log4J/IIB.log:

      on date change, directory is created but filename is not zipped. Also old file is not cleared out, but just appended to.
      Log4j2.xml:

      <Configuration status = "warn" name = "Log4j2_Configuration" monitorInterval = "60" packages = "">
          <Appenders>
              <RollingFile name = "RollingFile" fileName = "f:/Log4J/IIB.log" filePattern = "f:/Log4J/$${date:yyyy-MM}/IIB-%d{MM-dd-yyyy}-%i.log.zip" >
                  <PatternLayout>
                      <Pattern>%d %p %c{1} %m%n%n</Pattern>
                  </PatternLayout>
                  <Policies>
                      <TimeBasedTriggeringPolicy interval = "1" modulate = "true"/>
                  </Policies>
                  <DefaultRolloverStrategy fileIndex = "min" max = "7" compressionLevel = "5"/>
              </RollingFile>
          </Appenders>
          <Loggers>
              <Root level = "trace">
                  <AppenderRef ref = "RollingFile" level = "warn"/>
              </Root>
          </Loggers>
      </Configuration>
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              SAW Stephen A. Weinfield
            • Votes:
              3 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: