You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by ca...@apache.org on 2006/09/01 07:28:39 UTC
svn commit: r439188 -
/logging/log4j/trunk/src/java/org/apache/log4j/rolling/TimeBasedRollingPolicy.java
Author: carnold
Date: Thu Aug 31 22:28:39 2006
New Revision: 439188
URL: http://svn.apache.org/viewvc?rev=439188&view=rev
Log:
Bug 39994: TimeBasedRollingPolicy misidentifies .zip files as .gz
Modified:
logging/log4j/trunk/src/java/org/apache/log4j/rolling/TimeBasedRollingPolicy.java
Modified: logging/log4j/trunk/src/java/org/apache/log4j/rolling/TimeBasedRollingPolicy.java
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/src/java/org/apache/log4j/rolling/TimeBasedRollingPolicy.java?rev=439188&r1=439187&r2=439188&view=diff
==============================================================================
--- logging/log4j/trunk/src/java/org/apache/log4j/rolling/TimeBasedRollingPolicy.java (original)
+++ logging/log4j/trunk/src/java/org/apache/log4j/rolling/TimeBasedRollingPolicy.java Thu Aug 31 22:28:39 2006
@@ -184,7 +184,7 @@
if (lastFileName.endsWith(".gz")) {
suffixLength = 3;
} else if (lastFileName.endsWith(".zip")) {
- suffixLength = 3;
+ suffixLength = 4;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: svn commit: r439188 - /logging/log4j/trunk/src/java/org/apache/log4j/rolling/TimeBasedRollingPolicy.java
Posted by Curt Arnold <ca...@apache.org>.
On Sep 1, 2006, at 9:53 AM, Claudio Corsi wrote:
> Curt,
>
> Would you consider changing this to use a String array such that it
> calls the length method to set the suffixLength. For example,
>
> String suffixs[] = { ".gz", ".zip" };
>
> for(int idx = 0 ; idx < suffixs.length ; idx++ ) {
> if( lastFileName.endsWith(suffixs[idx]) {
> suffixLenth = suffixs[idx].length;
> break;
> }
> }
>
> --Claudio
>
When responding to a bug report, I typically try to keep the changes
to the minimum necessary to resolve the problem. In this case, all I
needed to change was one integer literal. Your suggestion would
definitely scale better that the original if more suffixes were
added. But I don't see any compelling reason to switch at this time.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: svn commit: r439188 - /logging/log4j/trunk/src/java/org/apache/log4j/rolling/TimeBasedRollingPolicy.java
Posted by Claudio Corsi <cc...@progress.com>.
Curt,
Would you consider changing this to use a String array such that it
calls the length method to set the suffixLength. For example,
String suffixs[] = { ".gz", ".zip" };
for(int idx = 0 ; idx < suffixs.length ; idx++ ) {
if( lastFileName.endsWith(suffixs[idx]) {
suffixLenth = suffixs[idx].length;
break;
}
}
--Claudio
carnold@apache.org wrote:
> Author: carnold
> Date: Thu Aug 31 22:28:39 2006
> New Revision: 439188
>
> URL: http://svn.apache.org/viewvc?rev=439188&view=rev
> Log:
> Bug 39994: TimeBasedRollingPolicy misidentifies .zip files as .gz
>
> Modified:
> logging/log4j/trunk/src/java/org/apache/log4j/rolling/TimeBasedRollingPolicy.java
>
> Modified: logging/log4j/trunk/src/java/org/apache/log4j/rolling/TimeBasedRollingPolicy.java
> URL: http://svn.apache.org/viewvc/logging/log4j/trunk/src/java/org/apache/log4j/rolling/TimeBasedRollingPolicy.java?rev=439188&r1=439187&r2=439188&view=diff
> ==============================================================================
> --- logging/log4j/trunk/src/java/org/apache/log4j/rolling/TimeBasedRollingPolicy.java (original)
> +++ logging/log4j/trunk/src/java/org/apache/log4j/rolling/TimeBasedRollingPolicy.java Thu Aug 31 22:28:39 2006
> @@ -184,7 +184,7 @@
> if (lastFileName.endsWith(".gz")) {
> suffixLength = 3;
> } else if (lastFileName.endsWith(".zip")) {
> - suffixLength = 3;
> + suffixLength = 4;
> }
> }
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org