ceki 01/07/05 09:54:39
Modified: docs critique.html
src/java/org/apache/log4j CompositeRollingAppender.java
src/java/org/apache/log4j/helpers OptionConverter.java
Log:
- Applied a simplified version of Colin Sampaleanu's patch to support BEA Weblogic
- Added Kevin Steppe's CompositeRollingAppender. I am somewhat uncomfortable with
it. Thus, it may be removed in the future.
Revision Changes Path
1.18 +6 -5 jakarta-log4j/docs/critique.html
Index: critique.html
===================================================================
RCS file: /home/cvs/jakarta-log4j/docs/critique.html,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- critique.html 2001/07/04 21:14:27 1.17
+++ critique.html 2001/07/05 16:54:33 1.18
@@ -487,14 +487,15 @@
<li><p><a href="pub-support/CamilleTroillard.html">Camille Troillard</a> <!-- -->
<li><p><a href="pub-support/MarcelHeemskerk.html">Marcel Heemskerk</a>
<li><p><a href="pub-support/BHA.html">BHA</a>
+<li><p><a href="pub-support/JeffreyMadynski.html">Jeffrey Madynski</a> <!-- -->
+<li><p><a href="pub-support/EigilHysvaer.html">Eigil Hysvaer</a>
+<li><p><a href="pub-support/Msew.html">Msew</a> <!-- -->
+<li><p><a href="pub-support/MiguelLaiz.html">Miguel Laiz</a>
+<li><p><a href="pub-support/ColinSampaleanu.html">Colin Sampaleanu</a> <!-- -->
<!--
-<li><p><a href="pub-support/.html"></a>
-<li><p><a href="pub-support/.html"></a>
-<li><p><a href="pub-support/.html"></a>
-<li><p><a href="pub-support/.html"></a>
-<li><p><a href="pub-support/.html"></a>
+
<li><p><a href="pub-support/.html"></a>
<li><p><a href="pub-support/.html"></a>
<li><p><a href="pub-support/.html"></a>
1.2 +15 -16
jakarta-log4j/src/java/org/apache/log4j/CompositeRollingAppender.java
Index: CompositeRollingAppender.java
===================================================================
RCS file:
/home/cvs/jakarta-log4j/src/java/org/apache/log4j/CompositeRollingAppender.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CompositeRollingAppender.java 2001/07/04 21:14:27 1.1
+++ CompositeRollingAppender.java 2001/07/05 16:54:35 1.2
@@ -32,12 +32,15 @@
import java.io.FilenameFilter;
/**
- * <p>CompositeRollingAppender combines RollingFileAppender and
DailyRollingFileAppender
- * It can function as either or and do both at the same time (making size
- * based rolling files like RollingFileAppender until a data/time boundary
- * is crossed at which time it rolls all of those files as per the
DailyRollingFileAppender)
- * based on the setting for <code>rollingStyle</code>.<br>
- * <p>A of few additional optional features have been added:<br>
+ <p>CompositeRollingAppender combines RollingFileAppender and
+ DailyRollingFileAppender. It can function as either or and do both
+ at the same time (making size based rolling files like
+ RollingFileAppender until a data/time boundary is crossed at which
+ time it rolls all of those files as per the
+ DailyRollingFileAppender) * based on the setting for
+ <code>rollingStyle</code>.<br>
+
+ <p>A of few additional optional features have been added:<br>
* -- Attach date pattern for current log file (@see staticLogFileName)<br>
* -- Backup number increments for newer files (@see countDirection)<br>
* -- Infinite number of backups by file size (@see masSizeRollBackups)<br>
@@ -56,8 +59,7 @@
* @author Kevin Steppe
* @author Heinz Richter
* @author Eirik Lygre
- * @author Ceki Gülcü
- */
+ * @author Ceki Gülcü */
public class CompositeRollingAppender extends org.apache.log4j.FileAppender {
// The code assumes that the following 'time' constants are in a increasing
// sequence.
@@ -440,8 +442,7 @@
String filter;
if (staticLogFileName || !rollDate) {
filter = baseFileName + ".*";
- }
- else {
+ } else {
filter = scheduledFilename + ".*";
}
@@ -473,8 +474,7 @@
LogLog.debug("From file: " + files[i] + " -> " + backup);
if (backup > curSizeRollBackups)
curSizeRollBackups = backup;
- }
- catch (Exception e) {
+ } catch (Exception e) {
//this happens when file.log -> file.log.yyyy-mm-dd which is normal
//when staticLogFileName == false
LogLog.debug("Encountered a backup file not ending in .x " + files[i]);
@@ -651,17 +651,16 @@
curSizeRollBackups--;
}
- // Map {(maxBackupIndex - 1), ..., 2, 1} to
{maxBackupIndex, ..., 3, 2}
+ // Map {(maxBackupIndex - 1), ..., 2, 1} to {maxBackupIndex, ..., 3, 2}
for (int i = curSizeRollBackups; i >= 1; i--) {
- rollFile((fileName + "." + i), (fileName + '.'
+ (i + 1)));
+ rollFile((fileName + "." + i), (fileName + '.' + (i + 1)));
}
curSizeRollBackups++;
// Rename fileName to fileName.1
rollFile(fileName, fileName + ".1");
- }
- else { //countDirection > 0
+ } else { //countDirection > 0
if (curSizeRollBackups >= maxSizeRollBackups && maxSizeRollBackups > 0) {
//delete the first and keep counting up.
int oldestFileIndex = curSizeRollBackups - maxSizeRollBackups + 1;
1.18 +9 -4
jakarta-log4j/src/java/org/apache/log4j/helpers/OptionConverter.java
Index: OptionConverter.java
===================================================================
RCS file:
/home/cvs/jakarta-log4j/src/java/org/apache/log4j/helpers/OptionConverter.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- OptionConverter.java 2001/06/20 07:59:46 1.17
+++ OptionConverter.java 2001/07/05 16:54:37 1.18
@@ -19,15 +19,15 @@
import org.apache.log4j.helpers.VersionHelper;
// Contributors: Avy Sharell ([EMAIL PROTECTED])
-// Anders Kristensen
// Matthieu Verbert ([EMAIL PROTECTED])
+// Colin Sampaleanu
-
/**
A convenience class to convert property values to specific types.
@author Ceki Gülcü
@author Simon Kitching;
+ @author Anders Kristensen
*/
public class OptionConverter {
@@ -420,13 +420,18 @@
<p>All configurations steps are taken on the
<code>hierarchy</code> passed as parameter.
- @author based on code written by Anders Kristensen
-
@since 1.0 */
static
public
void selectAndConfigure(URL url, Hierarchy hierarchy) {
String clazz = url.getRef();
+
+ if (clazz.indexOf('.') == -1 || clazz.indexOf('/') != -1 || clazz.indexOf('\\')
!= -1) {
+ LogLog.warn("Suspicious reference in URL ["+url+
+ "] will ignore refence part assuming BEA Weblogic environment.");
+ clazz = null;
+ }
+
Configurator configurator = null;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]