ceki 01/03/20 08:06:17
Modified: docs HISTORY manual.html
org/apache/log4j AsyncAppender.java Layout.java
PropertyConfigurator.java
org/apache/log4j/helpers LogLog.java PatternParser.java
org/apache/log4j/performance Logging.java
org/apache/log4j/spi TriggeringEventEvaluator.java
org/apache/log4j/xml/examples package.html sample1.xml
sample2.xml sample3.xml sample4.xml
Added: org/apache/log4j/xml/examples sample5.xml
Log:
Documentation changes.
Changed org/apache/log4j/helpers/PatternParser.java to report the event
generation time instead of report time.
Revision Changes Path
1.26 +10 -0 jakarta-log4j/docs/HISTORY
Index: HISTORY
===================================================================
RCS file: /home/cvs/jakarta-log4j/docs/HISTORY,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- HISTORY 2001/03/04 23:57:18 1.25
+++ HISTORY 2001/03/20 16:05:24 1.26
@@ -6,6 +6,16 @@
[***] Changes requiring important modifications to existing client code.
+ March ??, 2001
+
+ - Release of version 1.1b1
+
+ - Added jar files required at build time to build/lib so that it is
+ now possible to compile log4j out of the box. [*]
+
+ - Added the setQuietMode(booelan) method to LogLog. In quiet mode
+ LogLog will not output anything even in case of errors. [*]
+
February 23, 2001
- Release of version 1.1b1
1.9 +20 -13 jakarta-log4j/docs/manual.html
Index: manual.html
===================================================================
RCS file: /home/cvs/jakarta-log4j/docs/manual.html,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- manual.html 2001/01/30 00:35:48 1.8
+++ manual.html 2001/03/20 16:05:26 1.9
@@ -119,10 +119,13 @@
<dl>
<dt><b>Named Hierarchy</b>
- <dd><p>A category is said to be a parent of another
-category if its name followed by a dot is a prefix of the child
-category name.
+ <dd><p>A category is said to be an <em>ancestor</em> of another
+ category if its name followed by a dot is a prefix of the
+ <em>descendant</em> category name. A category is said to be a
+ <em>parent</em> of a <em>child</em> category if there are no
+ ancestors between itself and the descendant category.
+
</dl>
</table>
@@ -200,7 +203,8 @@
<dd><p>The <em>inherited priority</em> for a given category
<i>C</i>, is equal to the first non-null priority in the category
-hierarchy, starting at <i>C</i>.
+hierarchy, starting at <i>C</i> and proceeding upwards in the
+hierarchy towards the <code>root</code> category.
</dl>
</table>
@@ -301,10 +305,13 @@
<dt><b>Basic Selection Rule</b>
<dd><p>A log statement of priority <i>p</i> in a category with
- inherited priority <i>q</i>, is enabled if <i> p >= q</i>.
+ inherited priority <i>q</i>, is enabled if <i> p >=
+ q</i>.
</dl>
</table>
+<p>This rule assumes that priorities are ordered as follows: <code>DEBUG
+< INFO < WARN < ERROR < FATAL</code>.
<p>Here is an example of this rule.
@@ -338,7 +345,7 @@
is possible to configure a category and then to retrieve the same
instance somewhere else in the code without passing around
references. Categories can be created and configured in any order. In
-particular, a parent category will find and link to its children even
+particular, a category will find and link to its descendants even
if it is instantiated after them.
<p>Configuration of the log4j environment is typically done at
@@ -401,15 +408,15 @@
<dl>
<dt><b>Appender Additivity</b>
- <dd><p>The output of a log statement of
- category <i>C</i> will go to all the appenders in <i>C</i> and
- its parents. This is the meaning of the term "appender additivity".
+ <dd><p>The output of a log statement of category <i>C</i> will
+ go to all the appenders in <i>C</i> and its ancestors. This is
+ the meaning of the term "appender additivity".
- <p>However, if a parent category of <i>C</i>, say <i>P</i>,
+ <p>However, if an ancestor of category <i>C</i>, say <i>P</i>,
has the additivity flag set to <code>false</code>, then
<i>C</i>'s output will be directed to all the appenders in
- <i>C</i> and it's parents upto and including <i>P</i> but not
- the appenders in any of the parents of <i>P</i>.
+ <i>C</i> and it's ancestors upto and including <i>P</i> but
+ not the appenders in any of the ancestors of <i>P</i>.
<p>Categories have their additivity flag set to
<code>true</code> by default.
@@ -440,7 +447,7 @@
<td>A-sec
<td>No appender accumulation as the additivity flag is set to
- <code>false</code>. flag.
+ <code>false</code>.
<tr><td>security.access <td>none <td> true <td> A-sec <td>Only
appenders of "security" as the additivity flag in "security" is
1.12 +5 -3 jakarta-log4j/org/apache/log4j/AsyncAppender.java
Index: AsyncAppender.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/AsyncAppender.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- AsyncAppender.java 2001/03/19 12:38:17 1.11
+++ AsyncAppender.java 2001/03/20 16:05:33 1.12
@@ -32,9 +32,11 @@
<p><b>Important note:</b> The <code>AsyncAppender</code> can only
be script configured using the {@link
- org.apache.log4j.xml.DOMConfigurator}. Refer to the
- <code>org/apache/log4j/performace/xml</code> directory for
- examples.
+ org.apache.log4j.xml.DOMConfigurator}. Refer to example configuration
+ files <a href="xml/examples/doc-files/sample4.xml">sample4.xml</a>
+ and <a href="xml/examples/doc-files/sample5.xml">sample5.xml</a>.
+
+
@author Ceki Gülcü
@since version 0.9.1 */
1.4 +0 -1 jakarta-log4j/org/apache/log4j/Layout.java
Index: Layout.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/Layout.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Layout.java 2001/01/17 09:28:54 1.3
+++ Layout.java 2001/03/20 16:05:34 1.4
@@ -74,5 +74,4 @@
public
boolean ignoresThrowable();
-
}
1.18 +1 -1 jakarta-log4j/org/apache/log4j/PropertyConfigurator.java
Index: PropertyConfigurator.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/PropertyConfigurator.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- PropertyConfigurator.java 2001/03/19 12:33:15 1.17
+++ PropertyConfigurator.java 2001/03/20 16:05:35 1.18
@@ -16,7 +16,7 @@
import org.apache.log4j.Priority;
import org.apache.log4j.DefaultCategoryFactory;
import org.apache.log4j.config.PropertySetter;
-import org.apache.log4j.config.PropertySetterException;
+//import org.apache.log4j.config.PropertySetterException;
import org.apache.log4j.spi.OptionHandler;
import org.apache.log4j.spi.Configurator;
import org.apache.log4j.spi.CategoryFactory;
1.6 +31 -3 jakarta-log4j/org/apache/log4j/helpers/LogLog.java
Index: LogLog.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/helpers/LogLog.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- LogLog.java 2001/01/17 09:28:56 1.5
+++ LogLog.java 2001/03/20 16:05:44 1.6
@@ -38,6 +38,11 @@
protected static boolean configDebugEnabled = false;
+ /**
+ In quietMode not even errors generate any output.
+ */
+ private static boolean quietMode = false;
+
private static final String PREFIX = "log4j: ";
private static final String ERR_PREFIX = "log4j:ERROR ";
private static final String WARN_PREFIX = "log4j:WARN ";
@@ -64,7 +69,7 @@
public
static
void debug(String msg) {
- if(configDebugEnabled) {
+ if(configDebugEnabled && !quietMode) {
System.out.println(PREFIX+msg);
}
}
@@ -76,7 +81,7 @@
public
static
void debug(String msg, Throwable t) {
- if(configDebugEnabled) {
+ if(configDebugEnabled && !quietMode) {
System.out.println(PREFIX+msg);
if(t != null)
t.printStackTrace(System.out);
@@ -92,6 +97,8 @@
public
static
void error(String msg) {
+ if(quietMode)
+ return;
System.err.println(ERR_PREFIX+msg);
}
@@ -103,6 +110,9 @@
public
static
void error(String msg, Throwable t) {
+ if(quietMode)
+ return;
+
System.err.println(ERR_PREFIX+msg);
if(t != null) {
t.printStackTrace();
@@ -110,12 +120,27 @@
}
/**
+ In quite mode no LogLog generates strictly no output, not even
+ for errors.
+
+ @param quietMode A true for not
+ */
+ public
+ static
+ void setQuietMode(boolean quietMode) {
+ LogLog.quietMode = quietMode;
+ }
+
+ /**
This method is used to output log4j internal warning
statements. There is no way to disable warning statements.
Output goes to <code>System.err</code>. */
public
static
void warn(String msg) {
+ if(quietMode)
+ return;
+
System.err.println(WARN_PREFIX+msg);
}
@@ -126,9 +151,12 @@
public
static
void warn(String msg, Throwable t) {
+ if(quietMode)
+ return;
+
System.err.println(WARN_PREFIX+msg);
if(t != null) {
t.printStackTrace();
}
- }
+ }
}
1.5 +3 -2 jakarta-log4j/org/apache/log4j/helpers/PatternParser.java
Index: PatternParser.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/helpers/PatternParser.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- PatternParser.java 2001/01/22 10:57:27 1.4
+++ PatternParser.java 2001/03/20 16:05:46 1.5
@@ -22,6 +22,7 @@
// Contributors: Nelson Minar <([EMAIL PROTECTED]>
// Igor E. Poteryaev <[EMAIL PROTECTED]>
+// Reinhard Deschler <[EMAIL PROTECTED]>
/**
Most of the work of the {@link org.apache.log4j.PatternLayout} class
@@ -426,7 +427,7 @@
public
String convert(LoggingEvent event) {
- date.setTime(System.currentTimeMillis());
+ date.setTime(event.timeStamp);
return df.format(date);
}
}
@@ -477,7 +478,7 @@
// We substract 1 from 'len' when assigning to 'end' to avoid out of
// bounds exception in return r.substring(end+1, len). This can happen if
- // precision is 1 and the category name ends with a dot. you
+ // precision is 1 and the category name ends with a dot.
int end = len -1 ;
for(int i = precision; i > 0; i--) {
end = n.lastIndexOf('.', end-1);
1.7 +1 -1 jakarta-log4j/org/apache/log4j/performance/Logging.java
Index: Logging.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/performance/Logging.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Logging.java 2001/02/21 22:28:17 1.6
+++ Logging.java 2001/03/20 16:05:54 1.7
@@ -269,7 +269,7 @@
for(int i = 0; i < runLength; i++) {
category.info(msg);
}
- return (System.currentTimeMillis() - before)*1000.0/runLength;
+ return ((System.currentTimeMillis() - before)*1000.0)/runLength;
}
static
1.3 +4 -3 jakarta-log4j/org/apache/log4j/spi/TriggeringEventEvaluator.java
Index: TriggeringEventEvaluator.java
===================================================================
RCS file:
/home/cvs/jakarta-log4j/org/apache/log4j/spi/TriggeringEventEvaluator.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TriggeringEventEvaluator.java 2000/12/26 23:20:32 1.2
+++ TriggeringEventEvaluator.java 2001/03/20 16:05:58 1.3
@@ -12,9 +12,10 @@
Implementions of this interface allow certain appenders to decide
when to perform an appender specific action.
- <p>See {@link org.apache.log4j.net.SMTPAppender} for an example of
- an appender that depends on a
- <code>TriggeringEventEvaluators</code>.
+ <p>For example the {@link org.apache.log4j.net.SMTPAppender} sends
+ an email when the {@link #isTriggeringEvent} method returns
+ <code>true</code> and adds the event to an internal buffer when the
+ returned result is <code>false</code>.
@author Ceki Gülcü
@since version 1.0
1.2 +6 -3 jakarta-log4j/org/apache/log4j/xml/examples/package.html
Index: package.html
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/xml/examples/package.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- package.html 2000/12/14 19:43:57 1.1
+++ package.html 2001/03/20 16:06:03 1.2
@@ -11,9 +11,12 @@
<p>See source code of <a
href="doc-files/XMLSample.java">XMLSample.java</a> showing how to
-configure with an XML file. Sample XML files <a
-href="doc-files/sample1.xml">sample1.xml</a> and <a
-href="doc-files/sample2.xml">sample2.xml</a> are provided.
+configure with an XML file. Sample XML files
+<a href="doc-files/sample1.xml">sample1.xml</a>,
+<a href="doc-files/sample2.xml">sample2.xml</a>,
+<a href="doc-files/sample3.xml">sample3.xml</a>,
+<a href="doc-files/sample4.xml">sample4.xml</a>,
+<a href="doc-files/sample5.xml">sample5.xml</a> are provided.
<hr>
<address></address>
1.4 +1 -1 jakarta-log4j/org/apache/log4j/xml/examples/sample1.xml
Index: sample1.xml
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/xml/examples/sample1.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- sample1.xml 2001/01/19 16:45:37 1.3
+++ sample1.xml 2001/03/20 16:06:05 1.4
@@ -7,7 +7,7 @@
<param name="File" value="System.out" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
- value="%d %-5p [%t] %C{2} (%F:%L) - %m\n"/>
+ value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</layout>
</appender>
1.4 +2 -2 jakarta-log4j/org/apache/log4j/xml/examples/sample2.xml
Index: sample2.xml
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/xml/examples/sample2.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- sample2.xml 2001/01/19 16:45:37 1.3
+++ sample2.xml 2001/03/20 16:06:06 1.4
@@ -7,7 +7,7 @@
<param name="File" value="A1.log" />
<param name="Append" value="false" />
<layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%t %-5p %c{2} - %m\n"/>
+ <param name="ConversionPattern" value="%t %-5p %c{2} - %m%n"/>
</layout>
</appender>
@@ -16,7 +16,7 @@
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
- value="%d %-5p [%t] %C{2} (%F:%L) - %m\n"/>
+ value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</layout>
</appender>
1.4 +1 -1 jakarta-log4j/org/apache/log4j/xml/examples/sample3.xml
Index: sample3.xml
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/xml/examples/sample3.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- sample3.xml 2001/01/19 16:45:37 1.3
+++ sample3.xml 2001/03/20 16:06:07 1.4
@@ -15,7 +15,7 @@
<param name="File" value="System.out"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
- value="%d %-5p [%t] %C{2} (%F:%L) - %m\n"/>
+ value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</layout>
</appender>
<category name="org.apache.log4j.xml">
1.4 +1 -1 jakarta-log4j/org/apache/log4j/xml/examples/sample4.xml
Index: sample4.xml
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/xml/examples/sample4.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- sample4.xml 2001/01/19 16:45:38 1.3
+++ sample4.xml 2001/03/20 16:06:08 1.4
@@ -11,7 +11,7 @@
<param name="File" value="temp"/>
<layout class="org.apache.log4j.2PatternLayout">
<param name="ConversionPattern"
- value="%d %-5p [%t] %C{2} (%F:%L) - %m\n"/>
+ value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</layout>
</appender>
1.1 jakarta-log4j/org/apache/log4j/xml/examples/sample5.xml
Index: sample5.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration configDebug="true">
<appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
<appender-ref ref="TEMP"/>
<appender-ref ref="CONSOLE"/>
</appender>
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</layout>
</appender>
<appender name="TEMP" class="org.apache.log4j.FileAppender">
<param name="File" value="temp"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</layout>
</appender>
<root>
<priority value="debug"/>
<appender-ref ref="ASYNC"/>
</root>
</log4j:configuration>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]