The max index can not greater than 20, hardcode, in FixedWindowRollingPolicy.java

    /**
     * It's almost always a bad idea to have a large window size, say over 20.
     */
    private static int MAX_WINDOW_SIZE = 20;



BR,
Mike(Yu, Chong-Chao)
 


------------------ 原始邮件 ------------------
发件人: "haobo liu"<lhbazazazv@gmail.com>;
发送时间: 2020年6月18日(星期四) 上午9:12
收件人: "logback users list"<logback-user@qos.ch>;
主题: Re: [logback-user] maxIndex issue

does '200KB' is effective? every file part size is '200KB'?

Joud Kassem <joud.kassem79@gmail.com> 于2020年6月17日周三 下午7:57写道:
Hi all,

I have my rollingFileAppender configured as follows:

appender("myAppender", RollingFileAppender) {
        file = "${logDir}/myApp.log"
        encoder(PatternLayoutEncoder) {
            charset = Charset.forName('UTF-8')
            pattern = log_pattern
        }
        rollingPolicy(FixedWindowRollingPolicy) {
            fileNamePattern = "${logDir}/myApp%i.log"
            minIndex = 1
            maxIndex = 24
        }
        triggeringPolicy(SizeBasedTriggeringPolicy) {
            maxFileSize = FileSize.valueOf("200KB")      
        }
    }

I had first the maxIndex = 20, i modified it to 24 and I'm testing. As I see the number of logs are 21 and rotating while it should be 24! I tested it a lot and still the same issue. Anybody has this issue before or knows why this is happening?

Thanks in advance,
Joud
_______________________________________________
logback-user mailing list
logback-user@qos.ch
http://mailman.qos.ch/mailman/listinfo/logback-user