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

RollingFileAppender should throw exception when File matches FileNamePattern

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 1.0.12
    • 1.0.9
    • logback-core
    • None

    Description

      Description

      On Tue, Jan 8, 2013 at 7:57 AM, ceki <ceki@qos.ch <ceki@qos.ch>>

      wrote:

      File property and the archived files should not point to the same
      file path. When you wish them to point to the same path, then File
      property should be omitted.

      Such a sanity check + unit test would be most welcome.

      The offending logback.xml was:

      <configuration>
      
          <timestamp key="currentDate" datePattern="yyyy_MM_dd" />
      
          <appender name="dataServiceRequestLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
      		<param name="File" value="${the.log.dir}/${currentDate}.WebService.log"/>
      		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      			<FileNamePattern>${the.log.dir}/%d{yyyy_MM_dd}.WebService.log</FileNamePattern>
      			<MaxHistory>30</MaxHistory>
      		</rollingPolicy>
              <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
      			<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level - %msg%n</pattern>
              </encoder>
      	</appender>
      

      Discussion

      For more details, go to http://mailman.qos.ch/pipermail/logback-user/2013-January/003652.html

      Pull Request

      TBD

      Attachments

        Activity

          People

            logback-dev Logback dev list
            the_alchemist The Alchemist
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: