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

Fix rollover to work when filePattern contains no directory components

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.8
    • 2.8.1
    • Appenders
    • 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

              ggregory Gary D. Gregory
              ggregory Gary D. Gregory
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: