ceki 01/04/26 10:31:07
Modified: . INSTALL
build build.xml
docs FAQ.html HISTORY download.html
src/java/org/apache/log4j AsyncAppender.java Category.java
src/java/org/apache/log4j/spi Filter.java
src/java/org/apache/log4j/varia Makefile
PriorityMatchFilter.java
src/java/org/apache/log4j/xml DOMConfigurator.java
src/xdocs download.xml
Added: src/java/org/apache/log4j/varia PriorityRangeFilter.java
Log:
Added Aaron Greenhouse's fixes to Category and AsyncAppender. Added Simon Kitching's
RangeFilter.
Revision Changes Path
1.14 +9 -0 jakarta-log4j/INSTALL
Index: INSTALL
===================================================================
RCS file: /home/cvs/jakarta-log4j/INSTALL,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- INSTALL 2001/04/26 08:16:20 1.13
+++ INSTALL 2001/04/26 17:30:56 1.14
@@ -63,6 +63,15 @@
Log4j is shipped with jaxp.jar and parser.jar files under the
build/lib/ directory.
+ -------------------
+ RollingFileAppender
+ -------------------
+
+ For rather involved reasons RollingFileAppender requires JDK 1.2
+ or above. This will be fixed in future releases of log4j. If you
+ need RollingFileAppender to run under JDK 1.1 then you can
+ simply remove RollingFileAppenderBeanInfo.class from log4j.jar.
+
------------
SMTPAppender
------------
1.29 +3 -24 jakarta-log4j/build/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-log4j/build/build.xml,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- build.xml 2001/04/22 21:23:42 1.28
+++ build.xml 2001/04/26 17:30:57 1.29
@@ -9,7 +9,7 @@
<!-- ================================================================= -->
<project name="log4j" default="usage" basedir=".." >
- <property name="version" value="1.1b5"/>
+ <property name="version" value="1.1b6"/>
<!-- The base directory relative to which most targets are built -->
<property name="base" value="."/>
@@ -68,14 +68,6 @@
</echo>
</target>
-
- <target name="swingCheck">
- <available classname="javax.swing.JTextPane" property="swing-present"/>
- </target>
- <target name="swing" depends="swingCheck" if="swing-present">
- <echo message="Swing is present."/>
- </target>
-
<target name="junitCheck">
<available classname="junit.framework.TestCase" property="junit-present"/>
</target>
@@ -133,8 +125,8 @@
<tstamp />
</target>
- <target name="build" depends="init, build.core, build.swing, build.xml,
- build.unitTests, build.javamail, build.jms"/>
+ <target name="build" depends="init, build.core, build.xml, build.unitTests,
+ build.javamail, build.jms"/>
<target name="build.core" depends="init">
<mkdir dir="${javac.dest}" />
@@ -156,19 +148,6 @@
/>
</target>
- <target name="build.swing" depends="init, swing" if="swing-present">
- <mkdir dir="${javac.dest}/icons"/>
- <copy todir="${javac.dest}/icons" >
- <fileset dir="${icons.source}"/>
- </copy>
-
- <javac srcdir="${java.source.dir}"
- destdir="${javac.dest}"
- includes="${stem}/gui/**/*.java"
- excludes="${stem}/gui/JListView.java, ${stem}/gui/JTableAppender.java"
- classpath="${classpath}"/>
- </target>
-
<target name="build.unitTests" depends="init, junit" if="junit-present">
<javac srcdir="${java.source.dir}"
destdir="${javac.dest}"
1.6 +8 -2 jakarta-log4j/docs/FAQ.html
Index: FAQ.html
===================================================================
RCS file: /home/cvs/jakarta-log4j/docs/FAQ.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- FAQ.html 2001/04/23 21:41:27 1.5
+++ FAQ.html 2001/04/26 17:30:58 1.6
@@ -112,7 +112,14 @@
<ul>
<p><li>Log4j is JDK 1.1.x compatible.
-
+
+ <p><li>Nevertheless, <code>RollingFileAppender</code> requires JDK
+ 1.2 or above. This will be fixed in future releases of log4j. If you
+ need <code>RollingFileAppender</code> to run under JDK 1.1 then you
+ can simply remove <code>RollingFileAppenderBeanInfo.class</code>
+ from log4j.jar.
+
+
<p><li>The DOMConfigurator is based on the DOM Level 1 API. The
DOMConfigurator.configure(Element) method will work with any
XML parser that will pass it a DOM tree.
@@ -133,7 +140,6 @@
<p><li>The <code>org.apache.log4j.net.JMSAppender</code> requires the
presence of the JMS API as well as JNDI.
-<p><li>The <code>org.apache.log4j.gui.TextPaneAppender</code> requires Swing.
<p><li>log4j test code relies on the <a
href="http://www.junit.org">JUnit</a> testing framework.
1.45 +7 -4 jakarta-log4j/docs/HISTORY
Index: HISTORY
===================================================================
RCS file: /home/cvs/jakarta-log4j/docs/HISTORY,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- HISTORY 2001/04/26 08:16:21 1.44
+++ HISTORY 2001/04/26 17:30:58 1.45
@@ -8,15 +8,18 @@
April 26, 2001
- Release of version 1.1b6
+
+ - Aaron Greenhouse from Carnegie Mellon SCS found a series of
+ multi-threading related bugs in Category and AsyncAppender. See bug
+ ids 1505 and 1507 in our bug database for examplary bug
+ reports. They are worth the detour. [*]
- InvalidJarIndexException is only available in JDK 1.3. Referring
to this exception type caused log4j 1.1b5 to break on earlier JDKs.
We now avoid referring to it. [*]
- - Aaron Greenhouse found a series of multi-threading related bugs in
- Category and AsyncAppender. See bug ids 1505 and 1507 in our bug
- database for examplary bug reports. [*]
-
+ - Added PriorityRangeFilter by Simon Kitching. See the Threshold
+ option in AppenderSkeleton for a more convenient alternative. [*]
April 22, 2001
1.22 +4 -4 jakarta-log4j/docs/download.html
Index: download.html
===================================================================
RCS file: /home/cvs/jakarta-log4j/docs/download.html,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- download.html 2001/04/22 17:16:10 1.21
+++ download.html 2001/04/26 17:30:58 1.22
@@ -116,17 +116,17 @@
<table
border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
- <a name="log4j version 1.1beta5 (final-release candidate)"><strong>log4j
version 1.1beta5 (final-release candidate)</strong></a>
+ <a name="log4j version 1.1beta6 (final-release candidate)"><strong>log4j
version 1.1beta6 (final-release candidate)</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
- <p>Downlaod version 1.1beta5 (final-release
candiate) including
-<i>full source code</i>, class files and documentation in <a
href="../jakarta-log4j-1.1b5.tar.gz"><b>TAR.GZ</b></a> format or in <a
href="../jakarta-log4j-1.1b5.zip"><b>ZIP</b></a> format. You may elect
+ <p>Downlaod version 1.1beta6 (final-release
candiate) including
+<i>full source code</i>, class files and documentation in <a
href="../jakarta-log4j-1.1b6.tar.gz"><b>TAR.GZ</b></a> format or in <a
href="../jakarta-log4j-1.1b6.zip"><b>ZIP</b></a> format. You may elect
to browse log4j <a href="documentation.html"><b>documentation</b></a>
online. This release candidate should be sanctioned as the official
1.1 release after a short period of probation.</p>
- <p>Version 1.1b5 is the 21st major
public release of log4j. It is 100%
+ <p>Version 1.1b6 is the 21st major
public release of log4j. It is 100%
backward compatible with log4j version 1.0.x.</p>
<p>We also maintain a list of <a
href="earlier.html">earlier
versions</a> of log4j for download, intended for the curious
1.16 +13 -3 jakarta-log4j/src/java/org/apache/log4j/AsyncAppender.java
Index: AsyncAppender.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/AsyncAppender.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- AsyncAppender.java 2001/04/26 08:16:22 1.15
+++ AsyncAppender.java 2001/04/26 17:31:01 1.16
@@ -5,6 +5,8 @@
* License version 1.1, a copy of which has been included with this
* distribution in the LICENSE.APL file. */
+// Contibutors: Aaron Greenhouse <[EMAIL PROTECTED]>
+
package org.apache.log4j;
import org.apache.log4j.Category;
@@ -81,6 +83,8 @@
Dispatcher dispatcher;
boolean locationInfo = false;
+ boolean interruptedWarningMessage = false;
+
public
AsyncAppender() {
// Note: The dispatcher code assumes that the aai is set once and
@@ -94,7 +98,7 @@
public
void addAppender(Appender newAppender) {
aai.addAppender(newAppender);
- }
+ }
public
void append(LoggingEvent event) {
@@ -106,14 +110,20 @@
event.getLocationInformation();
}
synchronized(bf) {
- if(bf.isFull()) {
+ while(bf.isFull()) {
try {
//cat.debug("Waiting for free space in buffer.");
bf.wait();
} catch(InterruptedException e) {
- LogLog.error("AsyncAppender cannot be interrupted.", e);
+ if(!interruptedWarningMessage) {
+ interruptedWarningMessage = true;
+ LogLog.warn("AsyncAppender interrupted.", e);
+ } else {
+ LogLog.warn("AsyncAppender interrupted again.");
+ }
}
}
+
//cat.debug("About to put new event in buffer.");
bf.put(event);
if(bf.wasEmpty()) {
1.28 +2 -1 jakarta-log4j/src/java/org/apache/log4j/Category.java
Index: Category.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/Category.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- Category.java 2001/04/26 08:16:22 1.27
+++ Category.java 2001/04/26 17:31:03 1.28
@@ -13,8 +13,9 @@
// Avy Sharell <[EMAIL PROTECTED]>
// Ciaran Treanor <[EMAIL PROTECTED]>
// Jeff Turner <[EMAIL PROTECTED]>
-// Horwitz, Michael <[EMAIL PROTECTED]>
+// Michael Horwitz <[EMAIL PROTECTED]>
// Calvin Chan <[EMAIL PROTECTED]>
+// Aaron Greenhouse <[EMAIL PROTECTED]>
package org.apache.log4j;
1.3 +6 -23 jakarta-log4j/src/java/org/apache/log4j/spi/Filter.java
Index: Filter.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/spi/Filter.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Filter.java 2000/12/14 21:08:10 1.2
+++ Filter.java 2001/04/26 17:31:04 1.3
@@ -1,26 +1,9 @@
-/**
- Copyright (c) 2000, Ceki Gulcu
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
-*/
+/*
+ * Copyright (C) The Apache Software Foundation. All rights reserved.
+ *
+ * This software is published under the terms of the Apache Software
+ * License version 1.1, a copy of which has been included with this
+ * distribution in the LICENSE.APL file. */
package org.apache.log4j.spi;
1.6 +1 -0 jakarta-log4j/src/java/org/apache/log4j/varia/Makefile
Index: Makefile
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/varia/Makefile,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Makefile 2001/03/21 21:34:23 1.5
+++ Makefile 2001/04/26 17:31:05 1.6
@@ -6,6 +6,7 @@
DenyAllFilter.java\
StringMatchFilter.java\
PriorityMatchFilter.java\
+ PriorityRangeFilter.java\
SUBDIRS :=test
1.6 +4 -1
jakarta-log4j/src/java/org/apache/log4j/varia/PriorityMatchFilter.java
Index: PriorityMatchFilter.java
===================================================================
RCS file:
/home/cvs/jakarta-log4j/src/java/org/apache/log4j/varia/PriorityMatchFilter.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- PriorityMatchFilter.java 2001/04/03 16:37:36 1.5
+++ PriorityMatchFilter.java 2001/04/26 17:31:05 1.6
@@ -56,7 +56,7 @@
/**
@deprecated We now use JavaBeans introspection to configure
- components. Options strings are no longer needed.
+ components.
*/
public
String[] getOptionStrings() {
@@ -66,6 +66,9 @@
/**
@deprecated Use the setter method for the option directly instead
of the generic <code>setOption</code> method.
+
+ @deprecated We now use JavaBeans introspection to configure
+ components.
*/
public
void setOption(String key, String value) {
1.1
jakarta-log4j/src/java/org/apache/log4j/varia/PriorityRangeFilter.java
Index: PriorityRangeFilter.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.APL file.
*/
package org.apache.log4j.varia;
import org.apache.log4j.Priority;
import org.apache.log4j.spi.Filter;
import org.apache.log4j.spi.LoggingEvent;
import org.apache.log4j.helpers.LogLog;
import org.apache.log4j.helpers.OptionConverter;
/**
This is a very simple filter based on priority matching, which can be
used to reject messages with priorities outside a certain range.
<p>The filter admits three options <b>PriorityMin</b>, <b>PriorityMax</b>
and <b>AcceptOnMatch</b>.
<p>If the priority of the {@link LoggingEvent} is not between Min and Max
(inclusive), then {@link Filter#DENY} is returned.
<p> If the Logging event priority is within the specified range, then if
<b>AcceptOnMatch</b> is true, {@link Filter#ACCEPT} is returned, and if
<b>AcceptOnMatch</b> is false, {@link Filter#NEUTRAL} is returned.
<p>If <code>PriorityMin</code>w is not defined, then there is no
minimum acceptable priority (ie a priority is never rejected for
being too "low"/unimportant). If <code>PriorityMax</code> is not
defined, then there is no maximum acceptable priority (ie a
priority is never rejected for beeing too "high"/important).
<p>Refer to the {@link
org.apache.log4j.AppenderSkeleton#setThreshold setThreshold} method
available to <code>all</code> appenders extending {@link
org.apache.log4j.AppenderSkeleton} for a more convenient way to
filter out events by priority.
@author Simon Kitching
@author based on code by Ceki Gülcü
*/
public class PriorityRangeFilter extends Filter {
/**
Do we return ACCEPT when a match occurs. Default is
<code>false</code>, so that later filters get run by default */
boolean acceptOnMatch = false;
Priority priorityMin;
Priority priorityMax;
/**
Return the decision of this filter.
*/
public
int decide(LoggingEvent event) {
if(this.priorityMin != null) {
if (event.priority.isGreaterOrEqual(priorityMin) == false) {
// priority of event is less than minimum
return Filter.DENY;
}
}
if(this.priorityMax != null) {
if (event.priority.toInt() > priorityMax.toInt()) {
// priority of event is greater than maximum
// Alas, there is no Priority.isGreater method. and using
// a combo of isGreaterOrEqual && !Equal seems worse than
// checking the int values of the priority objects..
return Filter.DENY;
}
}
if (acceptOnMatch) {
// this filter set up to bypass later filters and always return
// accept if priority in range
return Filter.ACCEPT;
}
else {
// event is ok for this filter; allow later filters to have a look..
return Filter.NEUTRAL;
}
}
/**
Get the value of the <code>PriorityMax</code> option. */
public
Priority getPriorityMax() {
return priorityMax;
}
/**
Get the value of the <code>PriorityMin</code> option. */
public
Priority getPriorityMin() {
return priorityMin;
}
/**
Get the value of the <code>AcceptOnMatch</code> option.
*/
public
boolean getAcceptOnMatch() {
return acceptOnMatch;
}
/**
Set the <code>PriorityMax</code> option.
*/
public
void setPriorityMax(Priority priorityMax) {
this.priorityMax = priorityMax;
}
/**
Set the <code>PriorityMin</code> option.
*/
public
void setPriorityMin(Priority priorityMin) {
this.priorityMin = priorityMin;
}
/**
Set the <code>AcceptOnMatch</code> option.
*/
public
void setAcceptOnMatch(boolean acceptOnMatch) {
this.acceptOnMatch = acceptOnMatch;
}
/**
@deprecated We now use JavaBeans introspection to configure
components.
*/
public
String[] getOptionStrings() {
return new String[] {
PRIORITY_MIN_OPTION,
PRIORITY_MAX_OPTION,
ACCEPT_ON_MATCH_OPTION};
}
/**
@deprecated We now use JavaBeans introspection to configure
components.
*/
public
void setOption(String key, String value) {
if(key.equalsIgnoreCase(PRIORITY_MIN_OPTION)) {
priorityMin = OptionConverter.toPriority(value, null);
}
else if (key.equalsIgnoreCase(PRIORITY_MAX_OPTION)) {
priorityMax = OptionConverter.toPriority(value, null);
}
else if (key.equalsIgnoreCase(ACCEPT_ON_MATCH_OPTION)) {
acceptOnMatch = OptionConverter.toBoolean(value, acceptOnMatch);
}
}
/** See class comments */
public static final String PRIORITY_MIN_OPTION = "PriorityMin";
/** See class comments */
public static final String PRIORITY_MAX_OPTION = "PriorityMax";
/** See class comments */
public static final String ACCEPT_ON_MATCH_OPTION = "AcceptOnMatch";
}
1.17 +1 -0 jakarta-log4j/src/java/org/apache/log4j/xml/DOMConfigurator.java
Index: DOMConfigurator.java
===================================================================
RCS file:
/home/cvs/jakarta-log4j/src/java/org/apache/log4j/xml/DOMConfigurator.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- DOMConfigurator.java 2001/04/19 14:39:47 1.16
+++ DOMConfigurator.java 2001/04/26 17:31:06 1.17
@@ -554,6 +554,7 @@
// This makes ID/IDREF attributes to have a meaning. Don't ask
// me why.
dbf.setValidating(true);
+ //dbf.setNamespaceAware(true);
DocumentBuilder docBuilder = dbf.newDocumentBuilder();
//docBuilder.setErrorHandler(new ReportParserError());
1.18 +5 -5 jakarta-log4j/src/xdocs/download.xml
Index: download.xml
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/xdocs/download.xml,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- download.xml 2001/04/22 17:16:15 1.17
+++ download.xml 2001/04/26 17:31:06 1.18
@@ -32,17 +32,17 @@
-->
-<section name="log4j version 1.1beta5 (final-release candidate)">
+<section name="log4j version 1.1beta6 (final-release candidate)">
-<p>Downlaod version 1.1beta5 (final-release candiate) including
+<p>Downlaod version 1.1beta6 (final-release candiate) including
<i>full source code</i>, class files and documentation in <a
-href="../jakarta-log4j-1.1b5.tar.gz"><b>TAR.GZ</b></a> format or in <a
-href="../jakarta-log4j-1.1b5.zip"><b>ZIP</b></a> format. You may elect
+href="../jakarta-log4j-1.1b6.tar.gz"><b>TAR.GZ</b></a> format or in <a
+href="../jakarta-log4j-1.1b6.zip"><b>ZIP</b></a> format. You may elect
to browse log4j <a href="documentation.html"><b>documentation</b></a>
online. This release candidate should be sanctioned as the official
1.1 release after a short period of probation.</p>
-<p>Version 1.1b5 is the 21st major public release of log4j. It is 100%
+<p>Version 1.1b6 is the 21st major public release of log4j. It is 100%
backward compatible with log4j version 1.0.x.</p>
<p>We also maintain a list of <a href="earlier.html">earlier
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]