[logback-dev] [JIRA] Created: (LBCLASSIC-167) RollingFileAppender does not auto create subdirectories in some circumstances

Rick Janda (JIRA) noreply-jira at qos.ch
Fri Nov 6 14:43:45 CET 2009


RollingFileAppender does not auto create subdirectories in some circumstances
-----------------------------------------------------------------------------

                 Key: LBCLASSIC-167
                 URL: http://jira.qos.ch/browse/LBCLASSIC-167
             Project: logback-classic
          Issue Type: Bug
          Components: appender
    Affects Versions: 0.917
            Reporter: Rick Janda
            Assignee: Logback dev list


If the FileNamePattern of the rollingPolicy contains another directory than the File element of the appender, than the directory in the FileNamePattern is not created automatically.

The OnConsoleErrorListener writes out the following error in this case:
-ERROR in c.q.l.core.rolling.helper.Compress - Error occurred while compressing [/opt/baa-logserver/logs/logback.log33794048136194907.tmp] into [/opt/baa-logserver/logs/archive/logback_2009-10-26.log.zip]. java.io.FileNotFoundException: /opt/baa-logserver/logs/archive/logback_2009-10-26.log.zip (No such file or directory)
	at java.io.FileNotFoundException: /opt/baa-logserver/logs/archive/logback_2009-10-26.log.zip (No such file or directory)

The appender is configured as followed (files are rolled into a archive directory on daily basis):
    
<appender name="LOGBACK" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <File>${LOG_DIR}/logback.log</File>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <FileNamePattern>${LOG_DIR}/archive/logback_%d{yyyy-MM-dd}.log.zip</FileNamePattern>
            <MaxHistory>${MAX_HISTORY_DAYS}</MaxHistory>
        </rollingPolicy>

        <layout class="ch.qos.logback.classic.PatternLayout">
            <Pattern>%date{dd-MM-yyyy HH:mm:ss.SSS} [%contextName] \(%mdc{refId}\) %-5level %logger{0} - %msg%n%xEx{full}</Pattern>
        </layout>
 </appender>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the logback-dev mailing list