[
https://issues.apache.org/jira/browse/LOG4J2-1112?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jordan Guerin updated LOG4J2-1112:
----------------------------------
Comment: was deleted
(was: This is my log4j2.xml, With obfuscated LOG_DIR variables and logger class
name are obfuscated.)
> Using both OnStartupTriggeringPolicy and TimeBasedTriggeringPolicy create log
> file with wrong date
> --------------------------------------------------------------------------------------------------
>
> Key: LOG4J2-1112
> URL: https://issues.apache.org/jira/browse/LOG4J2-1112
> Project: Log4j 2
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.3
> Environment: Encountered on Ubuntu 64bit with Java 8, on CentOS with
> Java 8 too.
> Reporter: Jordan Guerin
>
> We found this bug while we were updating our logging library (from log4j 1.x
> to 2.3)
> We want to use mylog-%date\{yyyyMMdd-HHmmss} as filePattern for a
> RollingFileAppender.
> We're using 3 policies
> <OnStartupTriggeringPolicy />
> <SizeBasedTriggeringPolicy size="100 MB" />
> <TimeBasedTriggeringPolicy interval="86400" modulate="true" />
> We want to roll the file at each day, so we put 86400 seconds as the interval.
> But the problem we encounter, when the OnStartupTriggeringPolicy is
> triggering, our log file is named : mylog-20150905-114259.log instead of
> mylog-20150904-114259.log.
> It seems like the interval time of the TimeBasedTriggeringPolicy is added to
> the Date of the log filename. I did some further investigating, and when I
> put 3600 (one hour in seconds) as interval. Only one hour is added to the log
> filename.
> If I remove the OnStartupTriggeringPolicy, when it roll with the
> TimeBasedTrigger, the date is correct.
>
> What is weird too, if I use mylog-%date\{yyyyMMdd} and interval is 1 for
> TimeBasedTrigger, the date is correct when the log file roll on Startup. I
> tried with interval of 2, and the date is still okay.
> So the bug occurs only when we put time unit into the %date, when we use day
> unit, the date of the log filename is correct, but with minutes and seconds,
> we got a date in the future.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]