You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rg...@apache.org on 2023/01/03 01:11:11 UTC

[logging-log4j2] branch release-2.x updated (ff2abf866d -> e325de9abf)

This is an automated email from the ASF dual-hosted git repository.

rgoers pushed a change to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


    from ff2abf866d LOG4J2-2297 - Allow java.sql.Time objects to format properly in MapMessages.
     new cdca105dea LOG4J2-3357 - use time trigger was scheduled to fire instead of current time.
     new e325de9abf LOG4J2-3357 - use time trigger was scheduled to fire instead of current time.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../logging/log4j/core/appender/rolling/CronTriggeringPolicy.java    | 4 +++-
 src/changes/changes.xml                                              | 5 ++++-
 2 files changed, 7 insertions(+), 2 deletions(-)


[logging-log4j2] 01/02: LOG4J2-3357 - use time trigger was scheduled to fire instead of current time.

Posted by rg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rgoers pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit cdca105dea3ccf5df53622c0f16edfc4837960ac
Author: Ralph Goers <rg...@apache.org>
AuthorDate: Mon Jan 2 18:08:41 2023 -0700

    LOG4J2-3357 - use time trigger was scheduled to fire instead of current time.
---
 .../logging/log4j/core/appender/rolling/CronTriggeringPolicy.java     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/CronTriggeringPolicy.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/CronTriggeringPolicy.java
index b0297077e3..3ee8bdc469 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/CronTriggeringPolicy.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/CronTriggeringPolicy.java
@@ -146,7 +146,9 @@ public final class CronTriggeringPolicy extends AbstractTriggeringPolicy {
     }
 
     private void rollover() {
-    	manager.rollover(cronExpression.getPrevFireTime(new Date()), lastRollDate);
+        // If possible, use the time rollover was supposed to occur, not the actual time.
+        Date rollTime = future != null ? future.getFireTime() : new Date();
+        manager.rollover(cronExpression.getPrevFireTime(rollTime), lastRollDate);
         if (future != null) {
             lastRollDate = future.getFireTime();
         }


[logging-log4j2] 02/02: LOG4J2-3357 - use time trigger was scheduled to fire instead of current time.

Posted by rg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rgoers pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit e325de9abf771a4501bae7cd7910fcbce31f5663
Author: Ralph Goers <rg...@apache.org>
AuthorDate: Mon Jan 2 18:11:00 2023 -0700

    LOG4J2-3357 - use time trigger was scheduled to fire instead of current time.
---
 src/changes/changes.xml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 48665a81b4..672feb51f3 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -29,7 +29,10 @@
          - "update" - Change
          - "remove" - Removed
     -->
-    <release version="2.19.1" date="TBD" description="GA Release 2.19.1">
+    <release version="2.20.0" date="TBD" description="GA Release 2.20.0">
+      <action issue="LOG4J2-3357" dev="rgoers" type="fix">
+        Use time trigger was expected to fire instead of current time.
+      </action>
       <action issue="LOG4J2-2297" dev="rgoers" type="fix">
         Allow java.sql.Time objects to format properly in MapMessages.
       </action>