[
https://issues.apache.org/jira/browse/LOG4J2-1205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15027057#comment-15027057
]
Ralph Goers commented on LOG4J2-1205:
-------------------------------------
The TimeBasedTriggeringPolicy only checks for a rollover every 16 log events so
you may have a few events show up in the wrong file. Version 2.5 will
introduce a CronTriggeringPolicy that uses a background thread to trigger the
rollover. However, even with this it is possible that a few events could still
make it into the prior days file if the system is busy and the events are
processed before the rollover thread is allowed to run.
> RollingFileAppender logs first log to old dated file
> ----------------------------------------------------
>
> Key: LOG4J2-1205
> URL: https://issues.apache.org/jira/browse/LOG4J2-1205
> Project: Log4j 2
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 2.2
> Environment: The issue can be recreated in both Windows 7 and AIX.
> Reporter: Taisuke Tashiro
>
> When empty log file (0 byte) with old time stamp exists, RollingFileAppender
> logs first log to the rolled file.
> For example, when given the following configuration,
> {code}
> <RollingFile
> name="RollingFile"
> fileName="rolling.log"
> filePattern="rolling.log.%d{yyyyMMdd}">
> <PatternLayout pattern="%d{yyyy-MM-dd} %msg%n" />
> </RollingFile>
> {code}
> and empty rolling.log file exists with time stamp 2015-11-01, after logging
> two log records (say today) result as followings.
> rolling.log.201511{color:red}01{color}
> {quote}
> 2015-11-{color:red}25{color} FIRST LOG
> {quote}
> rolling.log
> {quote}
> 2015-11-25 SECOND LOG
> {quote}
> Both record should be logged in rolling.log file and no dated file created.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]