Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-85

logback 0.9.30 fileNamePattern does not create missing directories

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • logback-core
    • None

    Description

      We are using logback 0.9.30. In our logback configuration we have the need to create an appender that rolls over every day and the archives are stored in a separate directory. <fileNamePattern> tag does not seem to create the missing directories in the path. However, <File> tag under the <appender> seems to work fine.

      This is the sample configuration we have:

      <appender name="ABC" class="ch.qos.logback.core.rolling.RollingFileAppender">
      <file>/var/abc/abc.log</file>
      <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <!-- daily rollover -->
      <fileNamePattern>/var/abc/abc-archive/abc.%d

      {yyyy-MM-dd'T'HH}

      .log.gz</fileNamePattern>
      <maxHistory>365</maxHistory>
      </rollingPolicy>
      <encoder>
      <pattern>%msg%n</pattern>
      </encoder>
      </appender>

      "/var/abc/abc-archive" directory doesn't exist on the file system and i would expect that logback would create the missing directory. Please let us know if there is any piece missing in the configuration that would do that job or if its a genuine bug and would get fixed sometime soon.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            veda Vedavalli Kanala
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: