[logback-dev] [JIRA] Commented: (LBCORE-123) File not rolling over with SizeBasedTriggeringPolicy & FixedWindowRollingPolicy

Ceki Gulcu (JIRA) noreply-jira at qos.ch
Thu Oct 14 22:12:51 CEST 2010


    [ http://jira.qos.ch/browse/LBCORE-123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11848#action_11848 ] 

Ceki Gulcu commented on LBCORE-123:
-----------------------------------

Given that on some platforms computing file size is a relatively expensive operation, in the isTriggeringEvent method of SizeBasedTriggeringPolicy  class we check for the file size only once every 16 calls.  For long lived applications this is not a problem since it will eventually make 16 calls to isTriggeringEvent(). However, for short lived applications making few logging calls before shutting down, isTriggeringEvent () may never be called 16 times.

Does your cron job make few logging calls before shutting down?

> File not rolling over with SizeBasedTriggeringPolicy & FixedWindowRollingPolicy
> -------------------------------------------------------------------------------
>
>                 Key: LBCORE-123
>                 URL: http://jira.qos.ch/browse/LBCORE-123
>             Project: logback-core
>          Issue Type: Bug
>          Components: Rolling
>    Affects Versions: 0.9.17
>         Environment: Solaris 10 10/08 s10s_u6wos_07b SPARC
>            Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
>                         Use is subject to license terms.
>                             Assembled 27 October 2008
>            Reporter: Thomas Bednarek
>            Assignee: Ceki Gulcu
>         Attachments: bugtest.zip
>
>
> I have a process that is kicked off by cron.  It is suppose to role the file over with a size 1M.  It doesn't.  When I set it to 10K, it still doesn't.  Here is my config file:
> <?xml version="1.0" encoding="UTF-8"?>
> <configuration>
>  <appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="RootFileAppender">
>    <file>XMLExtract.log</file>
>    <append>true</append>
>    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
>      <level>info</level>
>    </filter>
>    <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
>      <fileNamePattern>/u01/oracle/XmlExtract/XMLExtract.%i.zip</fileNamePattern>
>      <maxIndex>5</maxIndex>
>    </rollingPolicy>
>    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
>      <maxFileSize>1M</maxFileSize>
>    </triggeringPolicy>
>    <layout class="ch.qos.logback.classic.PatternLayout">
>      <pattern>%d{&lt;yyyy-MM-dd [HH:mm:ss.SSS]&gt;},[%C{1}],[%M] --- %m%n</pattern>
>    </layout>
>  </appender>
>  <root>
>    <level value="info"/>
>    <appender-ref ref="RootFileAppender"/>
>  </root>
> </configuration>
> I looked at http://jira.qos.ch/browse/LBCLASSIC-105 and as you can see, I put the full path of where I want the files to be archived.  However, that has not worked for me either.

-- 
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