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/01/18 18:05:29 UTC

svn commit: r370187 [1/2] - in /logging/sandbox/log4j/log4jMini/trunk: ./ docs/ src/java/org/apache/log4j/ src/java/org/apache/log4j/examples/ src/java/org/apache/log4j/helpers/ src/java/org/apache/log4j/spi/ src/java/org/apache/log4j/test/

Author: carnold
Date: Wed Jan 18 09:05:18 2006
New Revision: 370187

URL: http://svn.apache.org/viewcvs?rev=370187&view=rev
Log:
Bug 37843: log4jMini switch to Logger from Category etc

Modified:
    logging/sandbox/log4j/log4jMini/trunk/build.xml
    logging/sandbox/log4j/log4jMini/trunk/docs/index.html
    logging/sandbox/log4j/log4jMini/trunk/docs/overview.html
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/Category.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/CategoryKey.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/FileAppender.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/Hierarchy.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/Logger.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/NDC.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/PatternLayout.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/PropertyConfigurator.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/ProvisionNode.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/StressCategory.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/WriterAppender.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/examples/Sort.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/examples/SortAlgo.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/examples/Trivial.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/examples/sort1.lcf
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/examples/sort2.lcf
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/examples/sort3.lcf
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/helpers/OptionConverter.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/helpers/PatternParser.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/spi/LoggingEvent.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/spi/RootCategory.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/spi/RootLogger.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/test/ConfigurationFileParsing.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/test/Hello.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/test/Min.java
    logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/test/Shallow.java

Modified: logging/sandbox/log4j/log4jMini/trunk/build.xml
URL: http://svn.apache.org/viewcvs/logging/sandbox/log4j/log4jMini/trunk/build.xml?rev=370187&r1=370186&r2=370187&view=diff
==============================================================================
--- logging/sandbox/log4j/log4jMini/trunk/build.xml (original)
+++ logging/sandbox/log4j/log4jMini/trunk/build.xml Wed Jan 18 09:05:18 2006
@@ -1,11 +1,11 @@
 
 <project name="log4jMini" default="build" basedir="." >
 
-  <property name="version" value="1.2alpha"/>
+	<property name="version" value="1_3alpha_7"/>
 
   <!-- The base directory relative to which most targets are built -->
   <property name="base" value="."/>
-
+ 
   <!-- The directory where source files are stored. -->
   <property name="java.source.dir" value="src/java/"/>
 
@@ -19,8 +19,8 @@
   <!-- Destination for generated jar files -->
   <property name="jar.dest" value="${basedir}"/>
 
-  <!-- The jar file that the jar task will generate -->
-  <property name="log4j.jar" value="log4jMini-${version}.jar"/>
+	  <!-- The jar file that the jar task will generate -->
+	  <property name="log4j.jar" value="log4jME-${version}.jar"/>
 
   <!-- Destination for documentation files generated or not -->
   <property name="docs" value="docs"/>
@@ -43,7 +43,7 @@
   <!-- Directory for temporary files. -->
   <property name="dist.tmp" value="dist/tmp"/>
 
-
+  
   <!-- Construct compile classpath -->
   <path id="compile.classpath">
     <pathelement location="${build.home}/classes"/>
@@ -51,7 +51,7 @@
 
   <target name="junitCheck">
     <available classname="junit.framework.TestCase" property="junit-present"/>
-  </target>
+  </target>   
   <target name="junit" depends="junitCheck" if="junit-present">
     <echo message="JUnit is present."/>
   </target>
@@ -68,14 +68,25 @@
     <mkdir dir="${javac.dest}" />
     <javac srcdir="${java.source.dir}"
            destdir="${javac.dest}"
-           includes="${stem}/**/*.java, ${stem}/xml/XMLLayout.java,"
-           excludes="**/examples/**, ${stem}/StressCategory.java"
+           includes="${stem}/**/*.java"
+           excludes="**/examples/**"
            deprecation="${deprecation}"
-           debug="on">
+           debug="off">
      <classpath refid="compile.classpath"/>
     </javac>
   </target>
 
+	  <target name="examples" depends="init">
+	    <mkdir dir="${javac.dest}" />
+	    <javac srcdir="${java.source.dir}"
+	           destdir="${javac.dest}"
+	           includes="${stem}/examples/*.java"
+	           deprecation="${deprecation}"
+	           debug="on">
+	     <classpath refid="compile.classpath"/>
+	    </javac>
+	  </target>
+
   <!-- ================================================================= -->
   <!-- Remove all generated (compiled) class files.                      -->
   <!-- ================================================================= -->
@@ -94,21 +105,16 @@
     </delete>
 
     <jar jarfile="${jar.dest}/${log4j.jar}" basedir="${javac.dest}"
-        includes="${stem}/*.class,
-              ${stem}/helpers/*.class,
-                  ${stem}/spi/*.class,
-          ${stem}/or/*.class,
-          ${stem}/config/PropertySetter.class
-          ${stem}/config/PropertySetterException.class"
-      excludes="**/UnitTest**,
-                **/examples/**,
-                **/selectors/*.class,
-                **/servlet/*.class">
+        includes=	"${stem}/*.class, 
+	          		${stem}/helpers/*.class,
+                  	${stem}/spi/*.class" 
+      excludes=	"**/test/**,
+                **/examples/**">
 
       <manifest>
         <attribute name="Manifest-version" value="1.0"/>
         <section name="org/apache/log4j/">
-          <attribute name="Implementation-Title" value="log4jMini"/>
+          <attribute name="Implementation-Title" value="log4jME"/>
           <attribute name="Implementation-Version" value="${version}"/>
           <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
         </section>
@@ -123,25 +129,25 @@
 
     <mkdir dir="${javadoc.dest}" />
 
-    <javadoc sourcepath="${java.source.dir}"
-           destdir="${javadoc.dest}"
-       packagenames="org.apache.log4j,
+    <javadoc sourcepath="${java.source.dir}" 
+           destdir="${javadoc.dest}" 
+	   packagenames="org.apache.log4j,
                          org.apache.log4j.helpers,
-                 org.apache.log4j.spi"
-       version="true"
-       protected="true"
-       author="true"
-       use="true"
-       overview="${docs}/overview.html"
-       doctitle="log4j MicroEdition version ${version}&lt;br&gt;API Specification"
-       windowtitle="Log4jME Version ${version}"
+		         org.apache.log4j.spi"
+	   version="true"
+	   protected="true"
+	   author="true"
+	   use="true"		   
+	   overview="${docs}/overview.html"
+	   doctitle="log4j MicroEdition version ${version}&lt;br&gt;API Specification"
+	   windowtitle="Log4jME Version ${version}" 
            header="&lt;b&gt;Log4jME ${version}&lt;/b&gt;"
-       bottom="Please &lt;a href=http://lists.sourceforge.net/mailman/listinfo/log4j-announce&gt;&lt;b&gt;notify me&lt;/b&gt;&lt;/a&gt; about new log4j releases. &lt;hr&gt;">
-
-           <link offline="true"
+	   bottom="Please &lt;a href=http://lists.sourceforge.net/mailman/listinfo/log4j-announce&gt;&lt;b&gt;notify me&lt;/b&gt;&lt;/a&gt; about new log4j releases. &lt;hr&gt;"> 
+		   
+           <link offline="true" 
                  href="http://java.sun.com/products/jdk/1.2/docs/api"
                  packageListLoc="${packaging.dir}"/>
-    </javadoc>
+    </javadoc>		
   </target>
 
  <!-- ================================================================= -->
@@ -150,24 +156,20 @@
   <target name="dist" depends="init, clean, jar">
 
     <delete verbose="true">
-      <fileset dir=".">
+      <fileset dir="."> 
         <patternset>
-       <include name="**/*.bak"/>
-       <include name="dist/velocity.log"/>
-       <include name="${BSTEM}/**/temp*"/>
-       <include name="${BSTEM}/performance/test"/>
-       <include name="${BSTEM}/test/current.*"/>
-       <include name="${BSTEM}/test/current.*"/>
-       <include name="${BSTEM}/examples/test"/>
-       <include name="${BSTEM}/test/logging.*"/>
-       <include name="${BSTEM}/test/log4j.properties"/>
-       <include name="{$BSTEM}/test/socket.lcf"/>
-       <include name="${BSTEM}/test/file"/>
-       <include name="${BSTEM}/test/output.*"/>
-       <include name="${jar.dest}/manifest.mf"/>
-       <include name="${javac.dest}/*.class"/>
+		   <include name="**/*.bak"/>
+		   <include name="dist/velocity.log"/>
+		   <include name="${BSTEM}/**/temp*"/>
+		   <include name="${BSTEM}/test/logging.*"/>
+		   <include name="${BSTEM}/test/log4j.properties"/>
+		   <include name="{$BSTEM}/test/socket.lcf"/>
+		   <include name="${BSTEM}/test/file"/>
+		   <include name="${BSTEM}/test/output.*"/>
+		   <include name="${jar.dest}/manifest.mf"/>
+		   <include name="${javac.dest}/*.class"/>
         </patternset>
-     </fileset>
+     </fileset>         
     </delete>
 
     <mkdir  dir="${dist.images}" />
@@ -177,42 +179,42 @@
     <copy todir="${dist.tmp}/log4jME-${version}">
        <fileset dir="${base}"
                 includes="make/**,
-                  src/**,
-              docs/**,
-              Makefile,
-              build/*, build.bat, build.sh,
-              build/lib/*.jar,
-                          manifest.mf,
-              INSTALL,
-              LICENSE.txt,
-              dist/lib/*.jar,
-                  org/**,
-              dist/classes/**"
-                excludes="make/make.loc,
-                  **/*.bak, **/goEnv.bat,
-              **/.#*"/>
+		          	src/**, 
+			  		docs/**, 
+			  		Makefile, 
+					build/*, build.bat, build.sh,
+					build/lib/*.jar,
+		            manifest.mf, 
+					INSTALL, 
+					LICENSE.txt, 
+					dist/lib/*.jar, 
+				    org/**,  
+					dist/classes/**,
+		    		${log4j.jar}"
+                excludes="make/make.loc, 
+		          	**/*.bak, **/goEnv.bat,
+			  		**/.#*"/>
     </copy>
 
-
-    <fixcrlf srcdir="${dist.tmp}/log4jME-${version}"
-             includes="build.sh" cr="remove"/>
-    <fixcrlf srcdir="${dist.tmp}/log4jME-${version}"
-             includes="build.bat" cr="add"/>
-    <chmod   dir="${dist.tmp}/log4jME-${version}"
+    
+    <fixcrlf srcdir="${dist.tmp}/log4jME-${version}"  
+             includes="build.sh" eol="unix"/>
+    <fixcrlf srcdir="${dist.tmp}/log4jME-${version}"   
+             includes="build.bat" eol="dos"/>
+    <chmod   dir="${dist.tmp}/log4jME-${version}"   
              includes="build.sh" perm="+x"/>
 
-    <tar tarfile="${dist.images}/log4jME-${version}.tar"
+    <tar tarfile="${dist.images}/log4jME-${version}.tar" 
          basedir="${dist.tmp}"
          includes="log4jME-${version}/**" />
 
-    <gzip src="${dist.images}/log4jME-${version}.tar"
+    <gzip src="${dist.images}/log4jME-${version}.tar" 
           zipfile="${dist.images}/log4jME-${version}.tar.gz" />
 
-    <zip zipfile="${dist.images}/log4jME-${version}.zip"
+    <zip zipfile="${dist.images}/log4jME-${version}.zip" 
          basedir="${dist.tmp}"
          includes="log4jME-${version}/**" />
-
-
+    	 
     <delete dir="${dist.tmp}" />
 
   </target>

Modified: logging/sandbox/log4j/log4jMini/trunk/docs/index.html
URL: http://svn.apache.org/viewcvs/logging/sandbox/log4j/log4jMini/trunk/docs/index.html?rev=370187&r1=370186&r2=370187&view=diff
==============================================================================
--- logging/sandbox/log4j/log4jMini/trunk/docs/index.html (original)
+++ logging/sandbox/log4j/log4jMini/trunk/docs/index.html Wed Jan 18 09:05:18 2006
@@ -12,10 +12,10 @@
 <code>log4jME.jar</code> with <code>log4j.jar</code> in your
 classpath.
 
-<p>Download log4jME version 1.0beta1 including full source code, class
+<p>Download log4jME version 1_3alpha_7 including full source code, class
 files and documentation in <a
-href="../log4jME-1.0b1.tar.gz"><b>TAR.GZ</b></a> format or in <a
-href="../log4jME-1.0b1.zip"><b>ZIP</b></a> format. 
+href="../log4jME-1_3alpha_7.tar.gz"><b>TAR.GZ</b></a> format or in <a
+href="../log4jME-1_3alpha_7.zip"><b>ZIP</b></a> format. 
 
 <p>You may also browse log4jME <a
 href="api/index.html">documentation</a>.

Modified: logging/sandbox/log4j/log4jMini/trunk/docs/overview.html
URL: http://svn.apache.org/viewcvs/logging/sandbox/log4j/log4jMini/trunk/docs/overview.html?rev=370187&r1=370186&r2=370187&view=diff
==============================================================================
--- logging/sandbox/log4j/log4jMini/trunk/docs/overview.html (original)
+++ logging/sandbox/log4j/log4jMini/trunk/docs/overview.html Wed Jan 18 09:05:18 2006
@@ -8,7 +8,7 @@
 <p>Log4jME, or log4j MicroEdition is based on nearly the same code as
 <a href="http://jakarta.apache.org/log4j">log4j</a>. However, as the
 name indicates the micro-edition is much smaller. It offers the same
-client interface such that code compiled for log4jME is 100%
+or similar client interface such that code compiled for log4jME is 100%
 compatible with log4j standard edition. You can choose to upgrade to
 log4j standard edition at any time by replacing
 <code>log4jME.jar</code> with <code>log4j.jar</code> in your
@@ -42,7 +42,8 @@
 <code>%c</code>, 
 <code>%m</code>, 
 <code>%n</code>
-as well as literals. In particular, the <code>%d</code> ans
+as well as literals. In particular, a modified support of
+is provided <code>%d</code> but
 <code>%x</code> conversion characters are not supported.
 
 <p><li><b>Smaller org.apache.log4j.PropertyConfigurator</b>

Modified: logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/Category.java
URL: http://svn.apache.org/viewcvs/logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/Category.java?rev=370187&r1=370186&r2=370187&view=diff
==============================================================================
--- logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/Category.java (original)
+++ logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/Category.java Wed Jan 18 09:05:18 2006
@@ -1,647 +0,0 @@
-/*
- * 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.txt file.  */
-
-// Contibutors: Alex Blewitt <Al...@ioshq.com>
-//              Markus Oestreicher <oe...@zurich.ibm.com>
-//              Frank Hoering <fh...@zurich.ibm.com>
-//              Nelson Minar <ne...@media.mit.edu>
-//              Jim Cakalic <ji...@na.biomerieux.com>
-//              Avy Sharell <as...@club-internet.fr>
-//              Ciaran Treanor <ci...@xelector.com>
-//              Jeff Turner <je...@socialchange.net.au>
-//              Michael Horwitz <MH...@siemens.co.za>
-//              Calvin Chan <ca...@hic.gov.au>
-//              Aaron Greenhouse <aa...@cs.cmu.edu>
-//              Beat Meier <bm...@infovia.com.ar>
-
-package org.apache.log4j;
-
-import org.apache.log4j.Priority;
-import org.apache.log4j.spi.RootCategory;
-import org.apache.log4j.spi.RootLogger;
-import org.apache.log4j.spi.LoggingEvent;
-import org.apache.log4j.helpers.LogLog;
-
-import java.util.Enumeration;
-import java.util.Vector;
-import java.util.MissingResourceException;
-import java.text.MessageFormat;
-import java.util.ResourceBundle;
-import java.net.URL;
-import java.net.MalformedURLException;
-
-
-/**
-  This is the central class in the log4j package. One of the
-  distintive features of log4j are hierarchical categories and their
-  evaluation.
-
-  <p>See the <a href="../../../../manual.html">user manual</a> for an
-  introduction on this class. 
-
-  @author Ceki G&uuml;lc&uuml;
-  @author Anders Kristensen */
-public class Category {
-
-  /**
-     The hierarchy where categories are attached to by default.
-  */
-  static 
-  public 
-  final Hierarchy defaultHierarchy = new Hierarchy(new 
-						   RootCategory(Priority.DEBUG));
-
-  /**
-     The name of this category.
-  */
-  protected String   name;  
-
-  /**
-     The assigned priority of this category.  The
-     <code>priority</code> variable need not be assined a value in
-     which case it is inherited form the hierarchy.  */
-  volatile protected Priority priority;
-
-  /**
-     The parent of this category. All categories have at least one
-     ancestor which is the root category. */
-  volatile protected Category parent;
-
-  // Categories need to know what Hierarchy they are in
-  protected Hierarchy hierarchy;
-  
-  /** Array of appenders. */
-  protected Vector  appenderList;
-
-  /** Additivity is set to true by default, that is children inherit
-      the appenders of their ancestors by default. If this variable is
-      set to <code>false</code> then the appenders found in the
-      ancestors of this category are not used. However, the children
-      of this category will inherit its appenders, unless the children
-      have their additivity flag set to <code>false</code> too. See
-      the user manual for more details. */
-  protected boolean additive = true;
-  
-  /**
-     This constructor created a new <code>Category</code> instance and
-     sets its name.
-
-     <p>It is intended to be used by sub-classes only. You should not
-     create categories directly.
-
-     @param name The name of the category.  
-  */
-  protected 
-  Category(String name) {
-    this.name = name;
-  }
-
-  /**
-     Add <code>newAppender</code> to the list of appenders of this
-     Category instance.
-
-     <p>If <code>newAppender</code> is already in the list of
-     appenders, then it won't be added again.
-  */
-  synchronized  
-  public 
-  void addAppender(Appender newAppender) {
-    // Null values for newAppender parameter are strictly forbidden.
-    if(newAppender == null)
-      return;
-    
-    if(appenderList == null) {
-      appenderList = new Vector(1);
-    }
-    if(!appenderList.contains(newAppender))
-      appenderList.addElement(newAppender);
-  }
-
-  public
-  int appendLoopOnAppenders(LoggingEvent event) {
-    int size = 0;
-    Appender appender;
-
-    if(appenderList != null) {
-      size = appenderList.size();
-      for(int i = 0; i < size; i++) {
-	appender = (Appender) appenderList.elementAt(i);
-	appender.doAppend(event);
-      }
-    }    
-    return size;
-  }
-
-  /**
-     Call the appenders in the hierrachy starting at
-     <code>this</code>.  If no appenders could be found, emit a
-     warning.
-
-     <p>This method calls all the appenders inherited from the
-     hierarchy circumventing any evaluation of whether to log or not
-     to log the particular log request.
-     
-     @param LoggingEvent the event to log.  */
-  public
-  void callAppenders(LoggingEvent event) {
-    int writes = 0;
-
-    for(Category c = this; c != null; c=c.parent) {
-      // Protected against simultaneous call to addAppender, removeAppender,...
-      synchronized(c) {
-	if(c.appenderList != null) {
-	  writes += c.appendLoopOnAppenders(event);
-	}
-	if(!c.additive) {
-	  break;
-	}
-      }
-    }
-    // No appenders in hierarchy, warn user only once.
-    if(!hierarchy.emittedNoAppenderWarning && writes == 0) {
-      LogLog.error("No appenders could be found for category (" +
-		    this.getName() + ").");
-      LogLog.error("Please initialize the log4j system properly.");
-      hierarchy.emittedNoAppenderWarning = true;
-    }
-  }
-
-  /** 
-    Log a message object with the {@link Priority#DEBUG DEBUG} priority.
-
-    <p>This method first checks if this category is <code>DEBUG</code>
-    enabled by comparing the priority of this category with the {@link
-    Priority#DEBUG DEBUG} priority. If this category is
-    <code>DEBUG</code> enabled, then it invokes all the registered
-    appenders in this category and also higher in the hierarchy
-    depending on the value of the additivity flag.
-
-    <p><b>WARNING</b> Note that passing a {@link Throwable} to this
-    method will print the name of the <code>Throwable</code> but no
-    stack trace. To print a stack trace use the {@link #debug(Object,
-    Throwable)} form instead.
-    
-    @param message the message object to log. */
-  public
-  void debug(Object message) {
-    if(hierarchy.enableInt >  Priority.DEBUG_INT) 
-      return;    
-    if(Priority.DEBUG.isGreaterOrEqual(this.getChainedPriority())) {
-      forcedLog(Priority.DEBUG, message, null);
-    }
-  }
-  
-
-  /**  
-   Log a message object with the <code>DEBUG</code> priority including
-   the stack trace of the {@link Throwable} <code>t</code> passed as
-   parameter.
-   
-   <p>See {@link #debug(Object)} form for more detailed information.
-   
-   @param message the message object to log.
-   @param t the exception to log, including its stack trace.  */  
-  public
-  void debug(Object message, Throwable t) {
-    if(hierarchy.enableInt >  Priority.DEBUG_INT) 
-      return;
-    if(Priority.DEBUG.isGreaterOrEqual(this.getChainedPriority()))
-      forcedLog(Priority.DEBUG, message, t);    
-  }
-
-  /** 
-    Log a message object with the {@link Priority#ERROR ERROR} priority.
-
-    <p>This method first checks if this category is <code>ERROR</code>
-    enabled by comparing the priority of this category with {@link
-    Priority#ERROR ERROR} priority.  If this category is
-    <code>DEBUG</code> enabled, then it invokes all the registered
-    appenders in this category and also higher in the hierarchy
-    depending on the value of the additivity flag.
-
-    <p><b>WARNING</b> Note that passing a {@link Throwable} to this
-    method will print the name of the <code>Throwable</code> but no
-    stack trace. To print a stack trace use the {@link #error(Object,
-    Throwable)} form instead.
-    
-    @param message the message object to log */
-  public
-  void error(Object message) {
-    if(hierarchy.enableInt >  Priority.ERROR_INT) 
-      return;
-    if(Priority.ERROR.isGreaterOrEqual(this.getChainedPriority()))
-      forcedLog(Priority.ERROR, message, null);
-  }
-
-  /** 
-   Log a message object with the <code>ERROR</code> priority including
-   the stack trace of the {@link Throwable} <code>t</code> passed as
-   parameter.
-   
-   <p>See {@link #error(Object)} form for more detailed information.
-   
-   @param message the message object to log.
-   @param t the exception to log, including its stack trace.  */  
-  public
-  void error(Object message, Throwable t) {
-    if(hierarchy.enableInt >  Priority.ERROR_INT) 
-      return;
-    if(Priority.ERROR.isGreaterOrEqual(this.getChainedPriority()))
-      forcedLog(Priority.ERROR, message, t);
-    
-  }
-
-  /** 
-    Log a message object with the {@link Priority#FATAL FATAL} priority.
-
-    <p>This method first checks if this category is <code>FATAL</code>
-    enabled by comparing the priority of this category with {@link
-    Priority#FATAL FATAL} priority.  If this category is
-    <code>DEBUG</code> enabled, then it invokes all the registered
-    appenders in this category and also higher in the hierarchy
-    depending on the value of the additivity flag.
-
-    <p><b>WARNING</b> Note that passing a {@link Throwable} to this
-    method will print the name of the Throwable but no stack trace. To
-    print a stack trace use the {@link #fatal(Object, Throwable)} form
-    instead. 
-    
-    @param message the message object to log */
-  public
-  void fatal(Object message) {
-    if(hierarchy.enableInt >  Priority.FATAL_INT) 
-      return;    
-    if(Priority.FATAL.isGreaterOrEqual(this.getChainedPriority()))
-      forcedLog(Priority.FATAL, message, null);
-  }
-  
-  /** 
-   Log a message object with the <code>FATAL</code> priority including
-   the stack trace of the {@link Throwable} <code>t</code> passed as
-   parameter.
-   
-   <p>See {@link #fatal(Object)} for more detailed information.
-   
-   @param message the message object to log.
-   @param t the exception to log, including its stack trace.  */
-  public
-  void fatal(Object message, Throwable t) {
-    if(hierarchy.enableInt >  Priority.FATAL_INT) 
-      return;   
-    if(Priority.FATAL.isGreaterOrEqual(this.getChainedPriority()))
-      forcedLog(Priority.FATAL, message, t);
-  }
-
-
-  /**
-     This method creates a new logging event and logs the event
-     without further checks.  */
-  protected
-  void forcedLog(Priority priority, Object message, Throwable t) {
-    callAppenders(new LoggingEvent(this, priority, message, t));
-  }
-
-
-  /**
-     Get the additivity flag for this Category instance.  
-  */
-  public
-  boolean getAdditivity() {
-    return additive;
-  }
-
-
-  /**
-     Starting from this category, search the category hierarchy for a
-     non-null priority and return it. Otherwise, return the priority of the
-     root category.
-     
-     <p>The Category class is designed so that this method executes as
-     quickly as possible.
-   */
-  public 
-  Priority getChainedPriority() {
-    for(Category c = this; c != null; c=c.parent) {
-      if(c.priority != null) 
-	return c.priority;
-    }
-    return null; // If reached will cause an NullPointerException.
-  }
-
- /**
-     Return the the {@link Hierarchy} where this <code>Category</code> instance is
-     attached.
-
-     @since 1.1 */
-  public  
-  Hierarchy getHierarchy() {
-    return hierarchy;
-  }
-
-  
- /**
-     Retrieve a category with named as the <code>name</code>
-     parameter. If the named category already exists, then the
-     existing instance will be reutrned. Otherwise, a new instance is
-     created. 
-
-     By default, categories do not have a set priority but inherit
-     it from the hierarchy. This is one of the central features of
-     log4j.
-
-     @param name The name of the category to retrieve.  */
-  public
-  static
-  Category getInstance(String name) {
-    return defaultHierarchy.getInstance(name);
-  }	
-
- /**
-    Shorthand for <code>getInstance(clazz.getName())</code>.
-
-    @param clazz The name of <code>clazz</code> will be used as the
-    name of the category to retrieve.  See {@link
-    #getInstance(String)} for more detailed information.
-
-    @since 1.0 */
-  public
-  static
-  Category getInstance(Class clazz) {
-    return getInstance(clazz.getName());
-  }	
-
-  /**
-     Return the category name.  */
-  public
-  final
-  String getName() {
-    return name;
-  }
-    
-  /**
-     Returns the assigned {@link Priority}, if any, for this Category.  
-     
-     @return Priority - the assigned Priority, can be <code>null</code>.
-  */
-  final
-  public
-  Priority getPriority() {
-    return this.priority;
-  }
-
-  /**
-     Return the root of the default category hierrachy.
-
-     <p>The root category is always instantiated and available. It's
-     name is "root".
-
-     <p>Nevertheless, calling {@link #getInstance
-     Category.getInstance("root")} does not retrieve the root category 
-     but a category just under root named "root".
-     
-   */
-  final
-  public
-  static
-  Category getRoot() {
-    return defaultHierarchy.getRoot();
-  }
-
-
-  /** 
-    Log a message object with the {@link Priority#INFO INFO} priority.
-
-    <p>This method first checks if this category is <code>INFO</code>
-    enabled by comparing the priority of this category with {@link
-    Priority#INFO INFO} priority.  If this category is
-    <code>DEBUG</code> enabled, then it invokes all the registered
-    appenders in this category and also higher in the hierarchy
-    depending on the value of the additivity flag.
-
-    <p><b>WARNING</b> Note that passing a {@link Throwable} to this
-    method will print the name of the Throwable but no stack trace. To
-    print a stack trace use the {@link #info(Object, Throwable)} form
-    instead. 
-    
-    @param message the message object to log */
-  public
-  void info(Object message) {
-    if(hierarchy.enableInt >  Priority.INFO_INT) 
-      return;    
-    if(Priority.INFO.isGreaterOrEqual(this.getChainedPriority()))
-      forcedLog(Priority.INFO, message, null);
-  }
-  
-  /** 
-   Log a message object with the <code>INFO</code> priority including
-   the stack trace of the {@link Throwable} <code>t</code> passed as
-   parameter.
-   
-   <p>See {@link #info(Object)} for more detailed information.
-   
-   @param message the message object to log.
-   @param t the exception to log, including its stack trace.  */
-  public
-  void info(Object message, Throwable t) {
-    if(hierarchy.enableInt >  Priority.INFO_INT) 
-      return;   
-    if(Priority.INFO.isGreaterOrEqual(this.getChainedPriority()))
-      forcedLog(Priority.INFO, message, t);
-  }
-
-  /**
-    *  Check whether this category is enabled for the <code>DEBUG</code>
-    *  priority.
-    *  
-    *  <p> This function is intended to lessen the computational cost of
-    *  disabled log debug statements.
-    * 
-    *  <p> For some <code>cat</code> Category object, when you write,
-    *  <pre>
-    *      cat.debug("This is entry number: " + i );
-    *  </pre>
-    *  
-    *  <p>You incur the cost constructing the message, concatenatiion in
-    *  this case, regardless of whether the message is logged or not.
-    * 
-    *  <p>If you are worried about speed, then you should write
-    *  <pre>
-    * 	 if(cat.isDebugEnabled()) { 
-    * 	   cat.debug("This is entry number: " + i );
-    * 	 }
-    *  </pre>
-    * 
-    *  <p>This way you will not incur the cost of parameter
-    *  construction if debugging is disabled for <code>cat</code>. On
-    *  the other hand, if the <code>cat</code> is debug enabled, you
-    *  will incur the cost of evaluating whether the category is debug
-    *  enabled twice. Once in <code>isDebugEnabled</code> and once in
-    *  the <code>debug</code>.  This is an insignificant overhead
-    *  since evaluating a category takes about 1%% of the time it
-    *  takes to actually log.
-    * 
-    *  @return boolean - <code>true</code> if this category is debug
-    *  enabled, <code>false</code> otherwise.
-    *   */
-  public
-  boolean isDebugEnabled() {
-    if(hierarchy.enableInt >  Priority.DEBUG_INT)
-      return false;   
-    return Priority.DEBUG.isGreaterOrEqual(this.getChainedPriority());
-  }
-  
-  /**
-     Check whether this category is enabled for a given {@link
-     Priority} passed as parameter.
-
-     See also {@link #isDebugEnabled}.
-       
-     @return boolean True if this category is enabled for <code>priority</code>.
-  */
-  public
-  boolean isEnabledFor(Priority priority) {
-    if(hierarchy.enableInt >  priority.level) 
-      return false;
-    return priority.isGreaterOrEqual(this.getChainedPriority());
-  }
-
-  /**
-    Check whether this category is enabled for the info priority.
-    See also {@link #isDebugEnabled}.
-
-    @return boolean - <code>true</code> if this category is enabled
-    for priority info, <code>false</code> otherwise.
-  */
-  public
-  boolean isInfoEnabled() {
-    if(hierarchy.enableInt > Priority.INFO_INT)
-      return false;   
-    return Priority.INFO.isGreaterOrEqual(this.getChainedPriority());
-  }
-
-
-  
-  /**
-     Remove all previously added appenders from this Category
-     instance.
-
-     <p>This is useful when re-reading configuration information.
-  */
-  synchronized
-  public
-  void removeAllAppenders() {
-    if(appenderList != null) {
-      int len = appenderList.size();      
-      for(int i = 0; i < len; i++) {
-	Appender a = (Appender) appenderList.elementAt(i);
-	a.close();
-      }
-      appenderList.removeAllElements();
-      appenderList = null;      
-    }
-  }
-
-  /**
-     Remove the appender passed as parameter form the list of appenders.
-
-     @since 0.8.2
-  */
-  synchronized
-  public
-  void removeAppender(Appender appender) {
-    if(appender == null || appenderList == null) 
-      return;
-    appenderList.removeElement(appender);    
-  }
-
-  /**
-     Remove the appender with the name passed as parameter form the
-     list of appenders.
-
-     @since 0.8.2 */
-  synchronized
-  public
-  void removeAppender(String name) {
-    if(name == null || appenderList == null) return;
-    int size = appenderList.size();
-    for(int i = 0; i < size; i++) {
-      if(name.equals(((Appender)appenderList.elementAt(i)).getName())) {
-	appenderList.removeElementAt(i);
-	break;
-      }
-    }
-  }
-  
-  /**
-     Set the additivity flag for this Category instance.
-     @since 0.8.1
-   */
-  public
-  void setAdditivity(boolean additive) {
-    this.additive = additive;
-  }
-
-  /**
-     Only the Hiearchy class can set the hiearchy of a
-     category. Default package access is MANDATORY here.  */
-  final
-  void setHierarchy(Hierarchy hierarchy) {
-    this.hierarchy = hierarchy;
-  }
-  
-  /**
-     Set the priority of this Category.
-
-     <p>Null values are admitted.
-  */
-  public
-  void setPriority(Priority priority) {
-    this.priority = priority;
-  }
-
-  /** 
-    Log a message object with the {@link Priority#WARN WARN} priority.
-
-    <p>This method first checks if this category is <code>WARN</code>
-    enabled by comparing the priority of this category with {@link
-    Priority#WARN WARN} priority.  If this category is
-    <code>DEBUG</code> enabled, then it invokes all the registered
-    appenders in this category and also higher in the hierarchy
-    depending on the value of the additivity flag.
-
-    <p><b>WARNING</b> Note that passing a {@link Throwable} to this
-    method will print the name of the Throwable but no stack trace. To
-    print a stack trace use the {@link #warn(Object, Throwable)} form
-    instead.  <p>
-    
-    @param message the message object to log.  */
-  public
-  void warn(Object message) {
-    if(hierarchy.enableInt >  Priority.WARN_INT) 
-      return;   
-
-    if(Priority.WARN.isGreaterOrEqual(this.getChainedPriority()))
-      forcedLog(Priority.WARN, message, null);    
-  }
-  
-  /** 
-   Log a message with the <code>WARN</code> priority including the
-   stack trace of the {@link Throwable} <code>t</code> passed as
-   parameter.
-   
-   <p>See {@link #warn(Object)} for more detailed information.
-   
-   @param message the message object to log.
-   @param t the exception to log, including its stack trace.  */
-  public
-  void warn(Object message, Throwable t) {
-    if(hierarchy.enableInt >  Priority.WARN_INT) 
-      return;   
-    if(Priority.WARN.isGreaterOrEqual(this.getChainedPriority()))
-      forcedLog(Priority.WARN, message, t);
-  }
-}

Modified: logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/CategoryKey.java
URL: http://svn.apache.org/viewcvs/logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/CategoryKey.java?rev=370187&r1=370186&r2=370187&view=diff
==============================================================================
--- logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/CategoryKey.java (original)
+++ logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/CategoryKey.java Wed Jan 18 09:05:18 2006
@@ -1,41 +0,0 @@
-/*
- * 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.txt file.  */
-
-package org.apache.log4j;
-
-/**
-   CategoryKey is heavily used internally to accelerate hash table searches.
-   @author Ceki G&uuml;lc&uuml; 
-*/
-class CategoryKey {
-
-  String   name;  
-  int hashCache;
-
-  CategoryKey(String name) {
-    this.name = name.intern();
-    hashCache = name.hashCode();
-  }
-
-  final
-  public  
-  int hashCode() {
-    return hashCache;
-  }
-
-  final
-  public
-  boolean equals(Object rArg) {
-    if(this == rArg)
-      return true;
-    
-    if(rArg != null && CategoryKey.class == rArg.getClass()) 
-      return  name == ((CategoryKey)rArg ).name;
-    else 
-      return false;
-  }
-}

Modified: logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/FileAppender.java
URL: http://svn.apache.org/viewcvs/logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/FileAppender.java?rev=370187&r1=370186&r2=370187&view=diff
==============================================================================
--- logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/FileAppender.java (original)
+++ logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/FileAppender.java Wed Jan 18 09:05:18 2006
@@ -25,6 +25,7 @@
    on the user's choice.
 
    @author Ceki G&uuml;lc&uuml;
+  * @author <a href="mailto:ralph.curtis@gabrielsoftware.com">Ralph Curtis</a>
    */
 public class FileAppender extends AppenderSkeleton {
 
@@ -49,13 +50,13 @@
   public static final String APPEND_OPTION = "Append";
 
   
-  /** Append to or truncate the file? The default value for this
+  /** Append to or truncate the file. The default value for this
       variable is <code>true</code>, meaning that by default a
       <code>FileAppender</code> will append to an existing file and
       not truncate it.
 
       <p>This option is meaningful only if the FileAppender opens the
-      file.      
+      file.</p>     
   */
   protected boolean fileAppend = true;
 
@@ -250,7 +251,7 @@
     untouched. It is the users responsability to close it.
 
     @param fileName The path to the log file.
-    @param boolean If true will append to fileName. Otherwise will
+    @param append If true will append to fileName. Otherwise will
     truncate fileName.  */
   public
   synchronized
@@ -338,7 +339,7 @@
 
     <p><b>WARNING:</b> Logging to an unopened Writer will fail.
     <p>  
-    @param Writer An already opened Writer.
+    @param writer An already opened Writer.
     @return Writer The previously attached Writer.
   */
   public

Modified: logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/Hierarchy.java
URL: http://svn.apache.org/viewcvs/logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/Hierarchy.java?rev=370187&r1=370186&r2=370187&view=diff
==============================================================================
--- logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/Hierarchy.java (original)
+++ logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/Hierarchy.java Wed Jan 18 09:05:18 2006
@@ -5,8 +5,8 @@
  * License version 1.1, a copy of which has been included with this
  * distribution in the LICENSE.txt file.  */
 
-// WARNING This class MUST not have references to the Category or
-// WARNING RootCategory classes in its static initiliazation neither 
+// WARNING This class MUST not have references to the Logger or
+// WARNING RootLogger classes in its static initiliazation neither 
 // WARNING directly nor indirectly.
 
 // Contributors:
@@ -27,17 +27,17 @@
 import org.apache.log4j.helpers.LogLog;
 
 /**
-   This class is specialized in retrieving categories by name and
-   also maintaining the category hierarchy.
+   This class is specialized in retrieving Loggers by name and
+   also maintaining the Logger hierarchy.
 
    <p><em>The casual user should not have to deal with this class
    directly.</em> In fact, up until version 0.9.0, this class had
    default package access. 
 
-   <p>The structure of the category hierarchy is maintained by the
+   <p>The structure of the Logger hierarchy is maintained by the
    {@link #getInstance} method. The hierarchy is such that children
    link to their parent but parents do not have any pointers to their
-   children. Moreover, categories can be instantiated in any order, in
+   children. Moreover, Loggers can be instantiated in any order, in
    particular descendant before ancestor.
 
    <p>In case a descendant is created before a particular ancestor,
@@ -46,12 +46,13 @@
    themselves to the previously created provision node.
 
    @author Ceki G&uuml;lc&uuml; 
+  * @author <a href="mailto:ralph.curtis@gabrielsoftware.com">Ralph Curtis</a>
 
 */
 public class Hierarchy {
 
   Hashtable ht;
-  Category root;
+  Logger root;
   
   int enableInt;
   Priority enable;
@@ -60,13 +61,13 @@
   boolean emittedNoResourceBundleWarning = false;  
 
   /**
-     Create a new Category hierarchy.
+     Create a new Logger hierarchy.
 
      @param root The root of the new hierarchy.
 
    */
   public
-  Hierarchy(Category root) {
+  Hierarchy(Logger root) {
     ht = new Hashtable();
     this.root = root;
     // Enable all priority levels by default.
@@ -104,44 +105,40 @@
   }
 
  /**
-     Return a new category instance named as the first parameter using
-     <code>factory</code>.
+     Return a new Logger instance named as specified.
      
-     <p>If a category of that name already exists, then it will be
-     returned.  Otherwise, a new category will be instantiated by the
-     <code>factory</code> parameter and linked with its existing
-     ancestors as well as children.
+     <p>If a logger of that name already exists, then it will be
+     returned.  Otherwise, a new Logger will be instantiated and linked with its existing
+     ancestors as well as children.</p>
      
-     @param name The name of the category to retrieve.
-     @param factory The factory that will make the new category instance.
-
+     @param name The name of the Logger to retrieve.
+     @return a new or existing logger with the specified name.
  */
   public
-  Category getInstance(String name) {
+  Logger getInstance(String name) {
     //System.out.println("getInstance("+name+") called.");
-    CategoryKey key = new CategoryKey(name);    
     // Synchronize to prevent write conflicts. Read conflicts (in
     // getChainedPriority method) are possible only if variable
     // assignments are non-atomic.
-    Category category;
+    Logger logger;
     
     synchronized(ht) {
-      Object o = ht.get(key);
+      Object o = ht.get(name);
       if(o == null) {
-	category = new Category(name);
-	category.setHierarchy(this);
-	ht.put(key, category);      
-	updateParents(category);
-	return category;
-      } else if(o instanceof Category) {
-	return (Category) o;
+	logger = new Logger(name);
+	logger.setHierarchy(this);
+	ht.put(name, logger);      
+	updateParents(logger);
+	return logger;
+      } else if(o instanceof Logger) {
+	return (Logger) o;
       } else if (o instanceof ProvisionNode) {
-	category = new Category(name);
-	category.setHierarchy(this); 
-	ht.put(key, category);
-	updateChildren((ProvisionNode) o, category);
-	updateParents(category);	
-	return category;
+	logger = new Logger(name);
+	logger.setHierarchy(this); 
+	ht.put(name, logger);
+	updateChildren((ProvisionNode) o, logger);
+	updateParents(logger);	
+	return logger;
       }
       else {
 	// It should be impossible to arrive here
@@ -156,7 +153,7 @@
      @since 0.9.0
    */
   public
-  Category getRoot() {
+  Logger getRoot() {
     return root;
   }
 
@@ -170,7 +167,7 @@
         We create a ProvisionNode for this potential parent and insert
         'cat' in that provision node.
 
-     2) There entry is of type Category for the potential parent.
+     2) There entry is of type Logger for the potential parent.
 
         The entry is 'cat's nearest existing parent. We update cat's
         parent field with this entry. We also break from the loop
@@ -183,7 +180,7 @@
    */
   final
   private
-  void updateParents(Category cat) {
+  void updateParents(Logger cat) {
     String name = cat.name;
     int length = name.length();
     boolean parentFound = false;
@@ -196,17 +193,16 @@
       String substr = name.substring(0, i);
 
       //System.out.println("Updating parent : " + substr);
-      CategoryKey key = new CategoryKey(substr); // simple constructor
-      Object o = ht.get(key);
+      Object o = ht.get(substr);
       // Create a provision node for a future parent.
       if(o == null) {
 	//System.out.println("No parent "+substr+" found. Creating ProvisionNode.");
 	ProvisionNode pn = new ProvisionNode(cat);
-	ht.put(key, pn);
-      } else if(o instanceof Category) {
+	ht.put(substr, pn);
+      } else if(o instanceof Logger) {
 	parentFound = true;
-	cat.parent = (Category) o;
-	//System.out.println("Linking " + cat.name + " -> " + ((Category) o).name);
+	cat.parent = (Logger) o;
+	//System.out.println("Linking " + cat.name + " -> " + ((Logger) o).name);
 	break; // no need to update the ancestors of the closest ancestor
       } else if(o instanceof ProvisionNode) {
 	((ProvisionNode) o).addElement(cat);
@@ -224,7 +220,7 @@
   /** 
       We update the links for all the children that placed themselves
       in the provision node 'pn'. The second argument 'cat' is a
-      reference for the newly created Category, parent of all the
+      reference for the newly created Logger, parent of all the
       children in 'pn'
 
       We loop on all the children 'c' in 'pn':
@@ -238,12 +234,12 @@
   */
   final
   private
-  void updateChildren(ProvisionNode pn, Category cat) {
+  void updateChildren(ProvisionNode pn, Logger cat) {
     //System.out.println("updateChildren called for " + cat.name);
     final int last = pn.size();
 
     for(int i = 0; i < last; i++) {
-      Category c = (Category) pn.elementAt(i);
+      Logger c = (Logger) pn.elementAt(i);
       //System.out.println("Updating child " +p.name);
 
       // Unless this child already points to a correct (lower) parent,
@@ -254,6 +250,15 @@
       }
     }
   }    
+
+  /**
+   * Clear all entries from the internal hash table.
+   *
+   */
+  public void clear() {
+	  ht.clear();
+  }
+
 
 }
 

Modified: logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/Logger.java
URL: http://svn.apache.org/viewcvs/logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/Logger.java?rev=370187&r1=370186&r2=370187&view=diff
==============================================================================
--- logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/Logger.java (original)
+++ logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/Logger.java Wed Jan 18 09:05:18 2006
@@ -1,18 +1,645 @@
 /*
- *
- */
+ * 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.txt file.  */
+
+// Contibutors: Alex Blewitt <Al...@ioshq.com>
+//              Markus Oestreicher <oe...@zurich.ibm.com>
+//              Frank Hoering <fh...@zurich.ibm.com>
+//              Nelson Minar <ne...@media.mit.edu>
+//              Jim Cakalic <ji...@na.biomerieux.com>
+//              Avy Sharell <as...@club-internet.fr>
+//              Ciaran Treanor <ci...@xelector.com>
+//              Jeff Turner <je...@socialchange.net.au>
+//              Michael Horwitz <MH...@siemens.co.za>
+//              Calvin Chan <ca...@hic.gov.au>
+//              Aaron Greenhouse <aa...@cs.cmu.edu>
+//              Beat Meier <bm...@infovia.com.ar>
+
 package org.apache.log4j;
+ 
+import org.apache.log4j.Priority;
+import org.apache.log4j.spi.RootLogger;
+import org.apache.log4j.spi.LoggingEvent;
+import org.apache.log4j.helpers.LogLog;
+ 
+import java.util.Enumeration;
+import java.util.Vector;
+import java.util.MissingResourceException;
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+import java.net.URL;
+import java.net.MalformedURLException;
 
 
 /**
- * @author ewan.harrow
- */
-public class Logger extends Category {
-    
-    /**
-     * 
-     */
-    public Logger(String name) {
-        super(name);
+  This is the central class in the log4j package. One of the
+  distintive features of log4j are hierarchical loggers and their
+  evaluation.
+
+  <p>See the <a href="../../../../manual.html">user manual</a> for an
+  introduction on this class. 
+
+  @author Ceki G&uuml;lc&uuml;
+  @author Anders Kristensen 
+* @author <a href="mailto:ralph.curtis@gabrielsoftware.com">Ralph Curtis</a>
+*/
+public class Logger {
+  /**
+    The hierarchy where loggers are attached to by default.
+  */
+  static 
+  public 
+  final Hierarchy defaultHierarchy = new Hierarchy(new 
+						   RootLogger(Priority.DEBUG));
+
+  /**
+     The name of this Logger.
+  */
+  protected String   name;  
+
+  /**
+     The assigned priority of this Logger.  The
+     <code>priority</code> variable need not be assined a value in
+     which case it is inherited form the hierarchy.  */
+  volatile protected Priority priority;
+
+  /**
+     The parent of this Logger. All loggers have at least one
+     ancestor which is the root Logger. */
+  volatile protected Logger parent;
+
+  // Loggers need to know what Hierarchy they are in
+  protected Hierarchy hierarchy;
+  
+  /** Array of appenders. */
+  protected Vector  appenderList;
+
+  /** Additivity is set to true by default, that is children inherit
+      the appenders of their ancestors by default. If this variable is
+      set to <code>false</code> then the appenders found in the
+      ancestors of this Logger are not used. However, the children
+      of this Logger will inherit its appenders, unless the children
+      have their additivity flag set to <code>false</code> too. See
+      the user manual for more details. */
+  protected boolean additive = true;
+  
+  /**
+     This constructor created a new <code>Logger</code> instance and
+     sets its name.
+
+     <p>It is intended to be used by sub-classes only. You should not
+     create Loggers directly.
+
+     @param name The name of the Logger.  
+  */
+  protected 
+  Logger(String name) {
+    this.name = name;
+  }
+
+  /**
+     Add <code>newAppender</code> to the list of appenders of this
+     Logger instance.
+
+     <p>If <code>newAppender</code> is already in the list of
+     appenders, then it won't be added again.
+  */
+  synchronized  
+  public 
+  void addAppender(Appender newAppender) {
+    // Null values for newAppender parameter are strictly forbidden.
+    if(newAppender == null)
+      return;
+    
+    if(appenderList == null) {
+      appenderList = new Vector(1);
+    }
+    if(!appenderList.contains(newAppender))
+      appenderList.addElement(newAppender);
+  }
+
+  public
+  int appendLoopOnAppenders(LoggingEvent event) {
+    int size = 0;
+    Appender appender;
+
+    if(appenderList != null) {
+      size = appenderList.size();
+      for(int i = 0; i < size; i++) {
+	appender = (Appender) appenderList.elementAt(i);
+	appender.doAppend(event);
+      }
+    }    
+    return size;
+  }
+
+  /**
+     Call the appenders in the hierrachy starting at
+     <code>this</code>.  If no appenders could be found, emit a
+     warning.
+
+     <p>This method calls all the appenders inherited from the
+     hierarchy circumventing any evaluation of whether to log or not
+     to log the particular log request.
+     
+     @param event the event to log.  */
+  public
+  void callAppenders(LoggingEvent event) {
+    int writes = 0;
+
+    for(Logger c = this; c != null; c=c.parent) {
+      // Protected against simultaneous call to addAppender, removeAppender,...
+      synchronized(c) {
+	if(c.appenderList != null) {
+	  writes += c.appendLoopOnAppenders(event);
+	}
+	if(!c.additive) {
+	  break;
+	}
+      }
+    }
+    // No appenders in hierarchy, warn user only once.
+    if(!hierarchy.emittedNoAppenderWarning && writes == 0) {
+      LogLog.error("No appenders could be found for Logger (" +
+		    this.getName() + ").");
+      LogLog.error("Please initialize the log4j system properly.");
+      hierarchy.emittedNoAppenderWarning = true;
+    }
+  }
+
+  /** 
+    Log a message object with the {@link Priority#DEBUG DEBUG} priority.
+
+    <p>This method first checks if this Logger is <code>DEBUG</code>
+    enabled by comparing the priority of this Logger with the {@link
+    Priority#DEBUG DEBUG} priority. If this Logger is
+    <code>DEBUG</code> enabled, then it invokes all the registered
+    appenders in this Logger and also higher in the hierarchy
+    depending on the value of the additivity flag.
+
+    <p><b>WARNING</b> Note that passing a {@link Throwable} to this
+    method will print the name of the <code>Throwable</code> but no
+    stack trace. To print a stack trace use the {@link #debug(Object,
+    Throwable)} form instead.
+    
+    @param message the message object to log. */
+  public
+  void debug(Object message) {
+    if(hierarchy.enableInt >  Priority.DEBUG_INT) 
+      return;    
+    if(Priority.DEBUG.isGreaterOrEqual(this.getChainedPriority())) {
+      forcedLog(Priority.DEBUG, message, null);
+    }
+  }
+  
+
+  /**  
+   Log a message object with the <code>DEBUG</code> priority including
+   the stack trace of the {@link Throwable} <code>t</code> passed as
+   parameter.
+   
+   <p>See {@link #debug(Object)} form for more detailed information.
+   
+   @param message the message object to log.
+   @param t the exception to log, including its stack trace.  */  
+  public
+  void debug(Object message, Throwable t) {
+    if(hierarchy.enableInt >  Priority.DEBUG_INT) 
+      return;
+    if(Priority.DEBUG.isGreaterOrEqual(this.getChainedPriority()))
+      forcedLog(Priority.DEBUG, message, t);    
+  }
+
+  /** 
+    Log a message object with the {@link Priority#ERROR ERROR} priority.
+
+    <p>This method first checks if this Logger is <code>ERROR</code>
+    enabled by comparing the priority of this Logger with {@link
+    Priority#ERROR ERROR} priority.  If this Logger is
+    <code>DEBUG</code> enabled, then it invokes all the registered
+    appenders in this Logger and also higher in the hierarchy
+    depending on the value of the additivity flag.
+
+    <p><b>WARNING</b> Note that passing a {@link Throwable} to this
+    method will print the name of the <code>Throwable</code> but no
+    stack trace. To print a stack trace use the {@link #error(Object,
+    Throwable)} form instead.
+    
+    @param message the message object to log */
+  public
+  void error(Object message) {
+    if(hierarchy.enableInt >  Priority.ERROR_INT) 
+      return;
+    if(Priority.ERROR.isGreaterOrEqual(this.getChainedPriority()))
+      forcedLog(Priority.ERROR, message, null);
+  }
+
+  /** 
+   Log a message object with the <code>ERROR</code> priority including
+   the stack trace of the {@link Throwable} <code>t</code> passed as
+   parameter.
+   
+   <p>See {@link #error(Object)} form for more detailed information.
+   
+   @param message the message object to log.
+   @param t the exception to log, including its stack trace.  */  
+  public
+  void error(Object message, Throwable t) {
+    if(hierarchy.enableInt >  Priority.ERROR_INT) 
+      return;
+    if(Priority.ERROR.isGreaterOrEqual(this.getChainedPriority()))
+      forcedLog(Priority.ERROR, message, t);
+    
+  }
+
+  /** 
+    Log a message object with the {@link Priority#FATAL FATAL} priority.
+
+    <p>This method first checks if this Logger is <code>FATAL</code>
+    enabled by comparing the priority of this Logger with {@link
+    Priority#FATAL FATAL} priority.  If this Logger is
+    <code>DEBUG</code> enabled, then it invokes all the registered
+    appenders in this Logger and also higher in the hierarchy
+    depending on the value of the additivity flag.
+
+    <p><b>WARNING</b> Note that passing a {@link Throwable} to this
+    method will print the name of the Throwable but no stack trace. To
+    print a stack trace use the {@link #fatal(Object, Throwable)} form
+    instead. 
+    
+    @param message the message object to log */
+  public
+  void fatal(Object message) {
+    if(hierarchy.enableInt >  Priority.FATAL_INT) 
+      return;    
+    if(Priority.FATAL.isGreaterOrEqual(this.getChainedPriority()))
+      forcedLog(Priority.FATAL, message, null);
+  }
+  
+  /** 
+   Log a message object with the <code>FATAL</code> priority including
+   the stack trace of the {@link Throwable} <code>t</code> passed as
+   parameter.
+   
+   <p>See {@link #fatal(Object)} for more detailed information.
+   
+   @param message the message object to log.
+   @param t the exception to log, including its stack trace.  */
+  public
+  void fatal(Object message, Throwable t) {
+    if(hierarchy.enableInt >  Priority.FATAL_INT) 
+      return;   
+    if(Priority.FATAL.isGreaterOrEqual(this.getChainedPriority()))
+      forcedLog(Priority.FATAL, message, t);
+  }
+
+
+  /**
+     This method creates a new logging event and logs the event
+     without further checks.  */
+  protected
+  void forcedLog(Priority priority, Object message, Throwable t) {
+    callAppenders(new LoggingEvent(this, priority, message, t));
+  }
+
+
+  /**
+     Get the additivity flag for this Logger instance.  
+  */
+  public
+  boolean getAdditivity() {
+    return additive;
+  }
+
+
+  /**
+     Starting from this Logger, search the Logger hierarchy for a
+     non-null priority and return it. Otherwise, return the priority of the
+     root Logger.
+     
+     <p>The Logger class is designed so that this method executes as
+     quickly as possible.
+   */
+  public 
+  Priority getChainedPriority() {
+    for(Logger c = this; c != null; c=c.parent) {
+      if(c.priority != null) 
+	return c.priority;
     }
+    return null; // If reached will cause an NullPointerException.
+  }
+
+ /**
+     Return the the {@link Hierarchy} where this <code>Logger</code> instance is
+     attached.
+
+     @since 1.1 */
+  public  
+  Hierarchy getHierarchy() {
+    return hierarchy;
+  }
+
+  
+ /**
+     Retrieve a Logger with named as the <code>name</code>
+     parameter. If the named Logger already exists, then the
+     existing instance will be reutrned. Otherwise, a new instance is
+     created. 
+
+     By default, Loggers do not have a set priority but inherit
+     it from the hierarchy. This is one of the central features of
+     log4j.
+
+     @param name The name of the Logger to retrieve.  */
+  public
+  static
+  Logger getInstance(String name) {
+    return defaultHierarchy.getInstance(name);
+  }	
+
+ /**
+    Shorthand for <code>getInstance(clazz.getName())</code>.
+
+    @param clazz The name of <code>clazz</code> will be used as the
+    name of the Logger to retrieve.  See {@link
+    #getInstance(String)} for more detailed information.
+
+    @since 1.0 */
+  public
+  static
+  Logger getInstance(Class clazz) {
+    return getInstance(clazz.getName());
+  }	
+
+  /**
+     Return the Logger name.  */
+  public
+  final
+  String getName() {
+    return name;
+  }
+    
+  /**
+     Returns the assigned {@link Priority}, if any, for this Logger.  
+     
+     @return Priority - the assigned Priority, can be <code>null</code>.
+  */
+  final
+  public
+  Priority getPriority() {
+    return this.priority;
+  }
+
+  /**
+     Return the root of the default Logger hierrachy.
+
+     <p>The root Logger is always instantiated and available. It's
+     name is "root".
+
+     <p>Nevertheless, calling {@link #getInstance
+     Logger.getInstance("root")} does not retrieve the root Logger 
+     but a Logger just under root named "root".
+     
+   */
+  final
+  public
+  static
+  Logger getRoot() {
+    return defaultHierarchy.getRoot();
+  }
+
+
+  /** 
+    Log a message object with the {@link Priority#INFO INFO} priority.
+
+    <p>This method first checks if this Logger is <code>INFO</code>
+    enabled by comparing the priority of this Logger with {@link
+    Priority#INFO INFO} priority.  If this Logger is
+    <code>DEBUG</code> enabled, then it invokes all the registered
+    appenders in this Logger and also higher in the hierarchy
+    depending on the value of the additivity flag.
+
+   <p><b>WARNING</b> Note that passing a {@link Throwable} to this
+    method will print the name of the Throwable but no stack trace. To
+    print a stack trace use the {@link #info(Object, Throwable)} form
+    instead. 
+    
+    @param message the message object to log */
+  public
+  void info(Object message) {
+    if(hierarchy.enableInt >  Priority.INFO_INT) 
+      return;    
+    if(Priority.INFO.isGreaterOrEqual(this.getChainedPriority()))
+      forcedLog(Priority.INFO, message, null);
+  }
+  
+  /** 
+   Log a message object with the <code>INFO</code> priority including
+   the stack trace of the {@link Throwable} <code>t</code> passed as
+   parameter.
+   
+   <p>See {@link #info(Object)} for more detailed information.
+   
+   @param message the message object to log.
+   @param t the exception to log, including its stack trace.  */
+  public
+  void info(Object message, Throwable t) {
+    if(hierarchy.enableInt >  Priority.INFO_INT) 
+      return;   
+    if(Priority.INFO.isGreaterOrEqual(this.getChainedPriority()))
+      forcedLog(Priority.INFO, message, t);
+  }
+
+  /**
+    *  Check whether this Logger is enabled for the <code>DEBUG</code>
+    *  priority.
+    *  
+    *  <p> This function is intended to lessen the computational cost of
+    *  disabled log debug statements.
+    * 
+    *  <p> For some <code>cat</code> Logger object, when you write,
+    *  <pre>
+    *      cat.debug("This is entry number: " + i );
+    *  </pre>
+    *  
+    *  <p>You incur the cost constructing the message, concatenatiion in
+    *  this case, regardless of whether the message is logged or not.
+    * 
+    *  <p>If you are worried about speed, then you should write
+    *  <pre>
+    * 	 if(cat.isDebugEnabled()) { 
+    * 	   cat.debug("This is entry number: " + i );
+    * 	 }
+    *  </pre>
+    * 
+    *  <p>This way you will not incur the cost of parameter
+    *  construction if debugging is disabled for <code>cat</code>. On
+    *  the other hand, if the <code>cat</code> is debug enabled, you
+    *  will incur the cost of evaluating whether the Logger is debug
+    *  enabled twice. Once in <code>isDebugEnabled</code> and once in
+    *  the <code>debug</code>.  This is an insignificant overhead
+    *  since evaluating a Logger takes about 1%% of the time it
+    *  takes to actually log.
+    * 
+    *  @return boolean - <code>true</code> if this Logger is debug
+    *  enabled, <code>false</code> otherwise.
+    *   */
+  public
+  boolean isDebugEnabled() {
+    if(hierarchy.enableInt >  Priority.DEBUG_INT)
+      return false;   
+    return Priority.DEBUG.isGreaterOrEqual(this.getChainedPriority());
+  }
+  
+  /**
+     Check whether this Logger is enabled for a given {@link
+     Priority} passed as parameter.
+
+     See also {@link #isDebugEnabled}.
+       
+     @return boolean True if this Logger is enabled for <code>priority</code>.
+  */
+  public
+  boolean isEnabledFor(Priority priority) {
+    if(hierarchy.enableInt >  priority.level) 
+      return false;
+    return priority.isGreaterOrEqual(this.getChainedPriority());
+  }
+
+  /**
+    Check whether this Logger is enabled for the info priority.
+    See also {@link #isDebugEnabled}.
+
+    @return boolean - <code>true</code> if this Logger is enabled
+    for priority info, <code>false</code> otherwise.
+  */
+  public
+  boolean isInfoEnabled() {
+    if(hierarchy.enableInt > Priority.INFO_INT)
+      return false;   
+    return Priority.INFO.isGreaterOrEqual(this.getChainedPriority());
+  }
+
+
+  
+  /**
+     Remove all previously added appenders from this Logger
+     instance.
+
+     <p>This is useful when re-reading configuration information.
+  */
+  synchronized
+  public
+  void removeAllAppenders() {
+    if(appenderList != null) {
+      int len = appenderList.size();      
+      for(int i = 0; i < len; i++) {
+	Appender a = (Appender) appenderList.elementAt(i);
+	a.close();
+      }
+      appenderList.removeAllElements();
+      appenderList = null;      
+    }
+  }
+
+  /**
+     Remove the appender passed as parameter form the list of appenders.
+
+     @since 0.8.2
+  */
+  synchronized
+  public
+  void removeAppender(Appender appender) {
+    if(appender == null || appenderList == null) 
+      return;
+    appenderList.removeElement(appender);    
+  }
+
+  /**
+     Remove the appender with the name passed as parameter form the
+     list of appenders.
+
+     @since 0.8.2 */
+  synchronized
+  public
+  void removeAppender(String name) {
+    if(name == null || appenderList == null) return;
+    int size = appenderList.size();
+    for(int i = 0; i < size; i++) {
+      if(name.equals(((Appender)appenderList.elementAt(i)).getName())) {
+	appenderList.removeElementAt(i);
+	break;
+      }
+    }
+  }
+  
+  /**
+     Set the additivity flag for this Logger instance.
+     @since 0.8.1
+   */
+  public
+  void setAdditivity(boolean additive) {
+    this.additive = additive;
+  }
+
+  /**
+     Only the Hiearchy class can set the hiearchy of a
+     Logger. Default package access is MANDATORY here.  */
+  final
+  void setHierarchy(Hierarchy hierarchy) {
+    this.hierarchy = hierarchy;
+  }
+  
+  /**
+     Set the priority of this Logger.
+
+     <p>Null values are admitted.
+  */
+  public
+  void setPriority(Priority priority) {
+    this.priority = priority;
+  }
+
+  /** 
+    Log a message object with the {@link Priority#WARN WARN} priority.
+
+    <p>This method first checks if this Logger is <code>WARN</code>
+    enabled by comparing the priority of this Logger with {@link
+    Priority#WARN WARN} priority.  If this Logger is
+    <code>DEBUG</code> enabled, then it invokes all the registered
+    appenders in this Logger and also higher in the hierarchy
+    depending on the value of the additivity flag.
+
+    <p><b>WARNING</b> Note that passing a {@link Throwable} to this
+    method will print the name of the Throwable but no stack trace. To
+    print a stack trace use the {@link #warn(Object, Throwable)} form
+    instead.  <p>
+    
+    @param message the message object to log.  */
+  public
+  void warn(Object message) {
+    if(hierarchy.enableInt >  Priority.WARN_INT) 
+      return;   
+
+    if(Priority.WARN.isGreaterOrEqual(this.getChainedPriority()))
+      forcedLog(Priority.WARN, message, null);    
+  }
+  
+  /** 
+   Log a message with the <code>WARN</code> priority including the
+   stack trace of the {@link Throwable} <code>t</code> passed as
+   parameter.
+   
+   <p>See {@link #warn(Object)} for more detailed information.
+   
+   @param message the message object to log.
+   @param t the exception to log, including its stack trace.  */
+  public
+  void warn(Object message, Throwable t) {
+    if(hierarchy.enableInt >  Priority.WARN_INT) 
+      return;   
+    if(Priority.WARN.isGreaterOrEqual(this.getChainedPriority()))
+      forcedLog(Priority.WARN, message, t);
+  }
 }

Modified: logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/NDC.java
URL: http://svn.apache.org/viewcvs/logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/NDC.java?rev=370187&r1=370186&r2=370187&view=diff
==============================================================================
--- logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/NDC.java (original)
+++ logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/NDC.java Wed Jan 18 09:05:18 2006
@@ -63,12 +63,12 @@
    except the obvious mismatch between the real application context
    and the context set in the NDC.
 
-   <p>If configured to do so, {@link PatternLayout} and {@link
-   TTCCLayout} instances automatically retrieve the nested diagnostic
+   <p>If configured to do so, {@link PatternLayout} instances automatically 
+   retrieve the nested diagnostic
    context for the current thread without any user intervention.
    Hence, even if a servlet is serving multiple clients
    simultaneously, the logs emanating from the same code (belonging to
-   the same category) can still be distinguished because each client
+   the same Logger) can still be distinguished because each client
    request will have a different NDC tag.
 
    <p>Heavy duty systems should call the {@link #remove} method when
@@ -86,6 +86,7 @@
    thread, in particular to a child.
    
    @author Ceki G&uuml;lc&uuml;
+  * @author <a href="mailto:ralph.curtis@gabrielsoftware.com">Ralph Curtis</a>
    @since 0.7.0
   
 */
@@ -169,16 +170,16 @@
      <p>The parent thread can obtain a reference to its diagnostic
      context using the {@link #cloneStack} method.  It should
      communicate this information to its child so that it may inherit
-     the parent's diagnostic context.
+     the parent's diagnostic context.</p>
 
      <p>The parent's diagnostic context is cloned before being
      inherited. In other words, once inherited, the two diagnostic
-     contexts can be managed independently.
+     contexts can be managed independently.</p>
      
      <p>In java, a child thread cannot obtain a reference to its
      parent, unless it is directly handed the reference. Consequently,
      there is no client-transparent way of inheriting diagnostic
-     contexts. Do you know any solution to this problem?
+     contexts. Do you know any solution to this problem?</p>
 
      @param stack The diagnostic context of the parent thread.
 
@@ -191,20 +192,20 @@
   }
 
 
-  /**
-     <font color="#FF4040"><b>Never use this method directly, use the {@link
-     org.apache.log4j.spi.LoggingEvent#getNDC} method instead.</b></font>
-  */
-  static
-  public
-  String get() {
-    Stack s = (Stack) ht.get(Thread.currentThread());
-    if(s != null && !s.isEmpty()) 
-      return ((DiagnosticContext) s.peek()).fullMessage;
-    else
-      return null;
-  }
-  
+//  /**
+//     <font color="#FF4040"><b>Never use this method directly, use the {@link
+//     org.apache.log4j.spi.LoggingEvent#getNDC} method instead.</b></font>
+//  */
+//  static
+//  public
+//  String get() {
+//    Stack s = (Stack) ht.get(Thread.currentThread());
+//    if(s != null && !s.isEmpty()) 
+//      return ((DiagnosticContext) s.peek()).fullMessage;
+//    else
+//      return null;
+//  }
+//  
   /**
      Get the current nesting depth of this diagnostic context.
 

Modified: logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/PatternLayout.java
URL: http://svn.apache.org/viewcvs/logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/PatternLayout.java?rev=370187&r1=370186&r2=370187&view=diff
==============================================================================
--- logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/PatternLayout.java (original)
+++ logging/sandbox/log4j/log4jMini/trunk/src/java/org/apache/log4j/PatternLayout.java Wed Jan 18 09:05:18 2006
@@ -8,7 +8,7 @@
 
 package org.apache.log4j;
 
-import org.apache.log4j.Category;
+import org.apache.log4j.Logger;
 import org.apache.log4j.Priority;
 import org.apache.log4j.Layout;
 import org.apache.log4j.spi.LoggingEvent;
@@ -47,7 +47,7 @@
    <p>Each conversion specifier starts with a percent sign (%) and is
    followed by optional <em>format modifiers</em> and a <em>conversion
    character</em>. The conversion character specifies the type of
-   data, e.g. category, priority, date, thread name. The format
+   data, e.g. logger, priority, date, thread name. The format
    modifiers control such things as field width, padding, left and
    right justification. The following is a simple example.
 
@@ -55,7 +55,7 @@
    that the log4j environment was set to use a PatternLayout. Then the
    statements
    <pre>
-   Category root = Category.getRoot();
+   Logger root = Logger.getRoot();
    root.debug("Message 1");
    root.warn("Message 2");   
    </pre>
@@ -82,16 +82,16 @@
    <tr>
      <td align=center><b>c</b></td>
 
-     <td>Used to output the category of the logging event. The
-     category conversion specifier can be optionally followed by
+     <td>Used to output the Logger of the logging event. The
+     Logger conversion specifier can be optionally followed by
      <em>precision specifier</em>, that is a decimal constant in
      brackets.
 
      <p>If a precision specifier is given, then only the corresponding
-     number of right most components of the category name will be
-     printed. By default the category name is printed in full.
+     number of right most components of the Logger name will be
+     printed. By default the Logger name is printed in full.
 
-     <p>For example, for the category name "a.b.c" the pattern
+     <p>For example, for the Logger name "a.b.c" the pattern
      <b>%c{2}</b> will output "b.c".
 
      </td>
@@ -205,7 +205,19 @@
 
      <td>Used to output the number of milliseconds elapsed since the start
      of the application until the creation of the logging event.</td>
-   </tr>  
+   </tr>
+   
+   <tr>
+   		<td align=center><b>d</b></td>
+   		<td>Used to output the date and time in the format "yyyy.MM.dd hh:mm:ss LTZ" where
+   		LTZ is the local time zone (PST, EST, etc).</td>
+   </tr>
+   
+   <tr>
+   		<td align=center><b>D</b></td>
+   		<td>Used to output the date and time in the format "yyyy.MM.dd hh:mm:ss GMT" where
+   		GMT is the Greenwhich time zone.</td>
+   </tr>
    
 
    <tr>
@@ -264,7 +276,7 @@
    are dropped. This behavior deviates from the printf function in C
    where truncation is done from the end.
 
-   <p>Below are various format modifier examples for the category
+   <p>Below are various format modifier examples for the Logger
    conversion specifier.
 
    <p>
@@ -281,12 +293,12 @@
    <td align=center>20</td>
    <td align=center>none</td>
 
-   <td>Left pad with spaces if the category name is less than 20
+   <td>Left pad with spaces if the Logger name is less than 20
    characters long.
 
    <tr> <td align=center>%-20c</td> <td align=center>true</td> <td
    align=center>20</td> <td align=center>none</td> <td>Right pad with
-   spaces if the category name is less than 20 characters long.
+   spaces if the Logger name is less than 20 characters long.
    
    <tr>
    <td align=center>%.30c</td>
@@ -294,7 +306,7 @@
    <td align=center>none</td>
    <td align=center>30</td>
 
-   <td>Truncate from the beginning if the category name is longer than 30
+   <td>Truncate from the beginning if the Logger name is longer than 30
    characters.
 
    <tr>
@@ -303,8 +315,8 @@
    <td align=center>20</td>
    <td align=center>30</td>
 
-   <td>Left pad with spaces if the category name is shorter than 20
-   characters. However, if category name is longer than 30 characters,
+   <td>Left pad with spaces if the Logger name is shorter than 20
+   characters. However, if Logger name is longer than 30 characters,
    then truncate from the beginning.   
 
    <tr>
@@ -313,8 +325,8 @@
    <td align=center>20</td>
    <td align=center>30</td>
 
-   <td>Right pad with spaces if the category name is shorter than 20
-   characters. However, if category name is longer than 30 characters,
+   <td>Right pad with spaces if the Logger name is shorter than 20
+   characters. However, if Logger name is longer than 30 characters,
    then truncate from the beginning.   
    
    </table>
@@ -330,7 +342,7 @@
 
    <p><dd>Similar to the TTCC layout except that the relative time is
    right padded if less than 6 digits, thread name is right padded if
-   less than 15 characters and truncated if longer and the category
+   less than 15 characters and truncated if longer and the Logger
    name is left padded if shorter than 30 characters and truncated if
    longer.
    
@@ -342,6 +354,7 @@
    
    @author <a href="mailto:cakalijp@Maritz.com">James P. Cakalic</a>
    @author Ceki G&uuml;lc&uuml;
+  * @author <a href="mailto:ralph.curtis@gabrielsoftware.com">Ralph Curtis</a>
 
 
    @since 0.8.2 */
@@ -475,7 +488,7 @@
   }
 
   /**
-     The PatternLayout specific options are:
+     The PatternLayout specific options are.
 
      <p>
      <dl>



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org