[
https://issues.apache.org/jira/browse/LOG4J2-2394?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ralph Goers closed LOG4J2-2394.
-------------------------------
> RollingFile Appender rolls over differently from Log4j1.x implementation
> ------------------------------------------------------------------------
>
> Key: LOG4J2-2394
> URL: https://issues.apache.org/jira/browse/LOG4J2-2394
> Project: Log4j 2
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 2.11.0
> Reporter: M. Manna
> Priority: Minor
> Attachments: log4j2.xml
>
>
> We upgraded our web application to have Log4j 2.11 (from Log4j 1.2.15) with
> some backward compatibility using log4j 1.x API, so that other Apache distros
> can work without breaking things. We have verified the binding of new log4j2
> with SLF4J and confirmed that the log4j2.xml is indeed the only reference for
> log configuration.
> One of the things we have observed is the discrepancy in rollover behaviour
> for RollingFile.
> In log4j 1.x the rollover occurred in this way:
>
> 1) my file pattern is C:/mylogdir/my-log-file.log.%i.
> 2) When size-based policy is met, the rollover would be such that:
> i) the active log file segment will be my-log-file.log
> ii) the next one (immediate recent) will be my-log-file.log.1
> iii) the next one (immediate recent after ii above) will be
> my-log-file.log.2
>
> Since log4j 2.11 upgrade, what we can see is:
>
> i) The active log file segment is my-log-file.log
> ii) The next one (immediate recent) is my-log-file.log.N - where X is the
> max number of segment created so far.
> iii) The next one (after ii segment above) is my-log-file.log.N-1
> So for Log4j2.11 the segments are rolled over in incorrect order, and
> creating confusion within our support staff. Our config file is attached.
> What we can see from docs is that the fileIndex is defaulted to Max i.e. it's
> following the non-fixed window strategy for indexing. Is there any reason why
> 2.11 has this defaulted? This creates confusion since 1.2.x default wasn't
> this one.
> Regards,
--
This message was sent by Atlassian Jira
(v8.3.4#803005)