[logback-user] RollingFileAppender maxFileSize doesn't work properly

Mouhammad Kahwaji mhd.kahwaji80 at gmail.com
Thu Feb 20 12:17:20 CET 2020


Hi all,

I have a RollingFileAppender defined as follows:

appender("test", RollingFileAppender) {
            file = "${logDir}/logFile.log"
            encoder(PatternLayoutEncoder) {
                pattern = log_pattern_prod
            }
            rollingPolicy(FixedWindowRollingPolicy) {
                fileNamePattern = "${logDir}/logFile%i.log"
                minIndex = 1
                maxIndex = 3
            }
            triggeringPolicy(SizeBasedTriggeringPolicy) {
                maxFileSize = FileSize.valueOf("10KB")
            }
        }      root(DEBUG, ['test'])


I'm testing it, I get 3 archived files but the size of the files is
not limited to 10KB as you can see in the attachment

Why is this happening? The size of the files shouldn't exceed 10KB,
how rolling is working in this case?

Thanks in advance,

Mhd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20200220/ed2206d5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: log.png
Type: image/png
Size: 7549 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20200220/ed2206d5/attachment.png>


More information about the logback-user mailing list