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

file path can not to be created

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None
    • 1.0.0
    • None

    Description

      sometimes i want the compressed log into bak folder.it means the current log file and compressed file in different folder.I define a statement as follows。
      <property name="log.path" value="logs" />
      <property name="log.backup" value="logsBackup" />
      <appender name="info" class="ch.qos.logback.core.rolling.RollingFileAppender">
      <filter class="ch.qos.logback.classic.filter.LevelFilter">
      <level>INFO</level>
      <onMatch>ACCEPT</onMatch>
      <onMismatch>DENY</onMismatch>
      </filter>
      <file>${log.path}/info.log</file>
      <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <!-- rollover daily -->
      <fileNamePattern>${log.backup}/info-%d

      {yyyy-MM-dd}

      .%i.zip</fileNamePattern>
      <maxHistory>30</maxHistory>
      <timeBasedFileNamingAndTriggeringPolicy
      class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
      <maxFileSize>2KB</maxFileSize>
      </timeBasedFileNamingAndTriggeringPolicy>
      </rollingPolicy>
      <encoder>
      <pattern>[%-4level][%d

      {yyyy-MM-dd HH:mm:ss}

      ][%C:%F:%L] - %msg%n</pattern>
      </encoder>
      </appender>

      i expect the info log over 2KB then compressed and put it into logsBackup folder,but not.is there something wrong? or what to do?
      thanks very much!

      Attachments

        Activity

          People

            logback-dev Logback dev list
            doublerabbit zhihui mao
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: