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

Fix rollover to work when filePattern contains no directory components

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8
    • Fix Version/s: 2.8.1
    • Component/s: Appenders
    • Labels:
      None

      Description

      See https://github.com/apache/logging-log4j2/pull/59

      Prior to this patch, the following config threw NPE at parent.mkdirs() because parent was null when using e.g.:

              <RollingRandomAccessFile name="FILE"
                                       fileName="foo.log"
                                       filePattern="foo-%d{yyyy-MM-dd}-%i.log.gz"
                                       immediateFlush="false">
      

      while this config did not:

              <RollingRandomAccessFile name="FILE"
                                       fileName="foo.log"
                                       filePattern="./foo-%d{yyyy-MM-dd}-%i.log.gz"
                                       immediateFlush="false">
      

      e.g. by adding ./ in front of the filePattern value.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                garydgregory Gary Gregory
                Reporter:
                garydgregory Gary Gregory
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: