You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2015/07/08 20:14:03 UTC

logging-log4j2 git commit: [LOG4J2-1075] Added support for compressing to bzip2 format on file rollover. Added missing BZIP2 support in purge methods.

Repository: logging-log4j2
Updated Branches:
  refs/heads/master 7121fe223 -> 19fc1c913


[LOG4J2-1075] Added support for compressing to bzip2 format on file
rollover. Added missing BZIP2 support in purge methods.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/19fc1c91
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/19fc1c91
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/19fc1c91

Branch: refs/heads/master
Commit: 19fc1c913a381d20c34b565511136f0b62ae3196
Parents: 7121fe2
Author: ggregory <gg...@apache.org>
Authored: Wed Jul 8 11:14:01 2015 -0700
Committer: ggregory <gg...@apache.org>
Committed: Wed Jul 8 11:14:01 2015 -0700

----------------------------------------------------------------------
 .../log4j/core/appender/rolling/DefaultRolloverStrategy.java     | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/19fc1c91/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
index adcaf70..500c302 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
@@ -240,6 +240,8 @@ public class DefaultRolloverStrategy implements RolloverStrategy {
             suffixLength = FileExtensions.GZIP.length();
         } else if (FileExtensions.ZIP.isExtensionFor(highFilename)) {
             suffixLength = FileExtensions.ZIP.length();
+        } else if (FileExtensions.BZIP2.isExtensionFor(highFilename)) {
+            suffixLength = FileExtensions.BZIP2.length();
         }
 
         int maxIndex = 0;
@@ -357,6 +359,8 @@ public class DefaultRolloverStrategy implements RolloverStrategy {
             suffixLength = FileExtensions.GZIP.length();
         } else if (FileExtensions.ZIP.isExtensionFor(lowFilename)) {
             suffixLength = FileExtensions.ZIP.length();
+        } else if (FileExtensions.BZIP2.isExtensionFor(lowFilename)) {
+            suffixLength = FileExtensions.BZIP2.length();
         }
 
         for (int i = lowIndex; i <= highIndex; i++) {