RollingFileAppender maxFileSize doesn't work properly

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

The rolling get triggered when the size reaches the trigger. It’s not a guarantee that the size will never go above the configured value.

As I understood, the rolling gets triggered when the file size reaches 10KB... So you mean the time needed for the size to reach the trigger caused this size differences? So if I have a bigger maxFileSize like 20GB, this size difference won't be noticed? On Thu, Feb 20, 2020 at 1:07 PM David Roussel <nabble@diroussel.xsmail.com> wrote:
The rolling get triggered when the size reaches the trigger. It’s not a guarantee that the size will never go above the configured value.
_______________________________________________ logback-user mailing list logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

Yes, exactly. A few extra log lines are generally not a problem
On 20 Feb 2020, at 12:32, Mouhammad Kahwaji <mhd.kahwaji80@gmail.com> wrote:
As I understood, the rolling gets triggered when the file size reaches 10KB... So you mean the time needed for the size to reach the trigger caused this size differences? So if I have a bigger maxFileSize like 20GB, this size difference won't be noticed?
participants (2)
-
David Roussel
-
Mouhammad Kahwaji