Skip to content

Commit 3f05b48

Browse files
committed
LOG4J2-3357 - use time trigger was scheduled to fire instead of current time.
1 parent 8baedd7 commit 3f05b48

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/CronTriggeringPolicy.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ private static CronExpression getSchedule(final String expression) {
147147
}
148148

149149
private void rollover() {
150-
manager.rollover(cronExpression.getPrevFireTime(new Date()).getTime(), lastRollDate.getTime());
150+
Date rollTime = future != null ? future.getFireTime() : new Date();
151+
manager.rollover(cronExpression.getPrevFireTime(rollTime).getTime(), lastRollDate.getTime());
151152
if (future != null) {
152153
lastRollDate = future.getFireTime();
153154
}

src/changes/changes.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,10 @@
201201
Fixes incorrect constructor call in LocalizedMessageFactory.
202202
</action>
203203
</release>
204-
<release version="2.19.1" date="TBD" description="GA Release 2.19.1">
204+
<release version="2.20.0" date="TBD" description="GA Release 2.20.0">
205+
<action issue="LOG4J2-3357" dev="rgoers" type="fix">
206+
Use time trigger was expected to fire instead of current time.
207+
</action>
205208
<action issue="LOG4J2-2297" dev="rgoers" type="fix">
206209
Allow java.sql.Time objects to format properly in MapMessages.
207210
</action>

0 commit comments

Comments
 (0)