Description
Description
The default rollover strategy in Log4j 1.x archived the current log file File
always to File.1
:
If
MaxBackupIndex
is positive, then files{File.1, ..., File.MaxBackupIndex -1}
are renamed to{File.2, ..., File.MaxBackupIndex}
. Moreover,File
is renamedFile.1
and closed. A newFile
is created to receive further log output. [source Javadoc]
This corresponds to the fileIndex="min"
rollover strategy of the version 2.x RollingFileAppender
(cf. documentation).
However the RollingFileAppenderBuilder
from log4j-1.2-api
creates a fileIndex="max"
rollover strategy (the default strategy in Log4j 2.x).
This problem was reported in the SO question Log4j 1.2 Bridge update to 2.17.2 RollingFileAppender MaxBackupIndex Problem.
Affected version
Versions 2.20.0
and 3.0.0-alpha1
are both affected.