[logback-dev] dailly rollingPolicy for log-%d{yyyy-MM-dd}.%i.log.gz does not work

Parimah MehrRostami parimah at hotmail.com
Sat May 17 00:59:15 CEST 2014









Hi 
 I have the following log backup.xml 
<configuration scan="true" scanPeriod="30 seconds">
  <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>/opt/apps/scms/logs/scms.log</file>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <!-- rollover daily -->
      <fileNamePattern>/opt/apps/scms/logs/scms-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
      <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
        <maxFileSize>100MB</maxFileSize>
      </timeBasedFileNamingAndTriggeringPolicy>
    </rollingPolicy>
    <encoder>
      <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS,PST} [%thread] %-5level %X{user} %logger{0} - %msg%n%xEx{3}</pattern>
      <outputPatternAsHeader>true</outputPatternAsHeader>
    </encoder>
  </appender>
…
And this use to work fine.. Since 10 days ago I deploy my application and since then instead the files being rolled on daily bases or if they reach 100MB I have 10s of smaller than 1MB files.. One or two of the log files each they are 1.2 or max 1.5 MB.. 
I have made sure that this configuration is being used by  changing the maxFileSize to         <maxFileSize>10KB</maxFileSize> and logs are less than 10KB .. 
Anyone out there has seen similar issues or can give me a clue what I am doing wrong…
Thanks
Parimah Mehrrostami 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-dev/attachments/20140516/86104100/attachment.html>


More information about the logback-dev mailing list