Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 72532 invoked from network); 7 Mar 2002 22:32:52 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 7 Mar 2002 22:32:52 -0000 Received: (qmail 3126 invoked by uid 97); 7 Mar 2002 22:32:56 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 3110 invoked by uid 97); 7 Mar 2002 22:32:56 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 3099 invoked by uid 97); 7 Mar 2002 22:32:55 -0000 Date: 7 Mar 2002 22:32:47 -0000 Message-ID: <20020307223247.63730.qmail@icarus.apache.org> From: costin@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/logging/src/java/org/apache/commons/logging/impl Log4JCategoryLog.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N costin 02/03/07 14:32:47 Modified: logging/src/java/org/apache/commons/logging/impl Log4JCategoryLog.java Log: Patch from Richard Sitze . > I've updated the Log4JCategoryLog.java to use the Log4J method Category.log > () which allows the fully qualified class name (FQCN) of the user's logger > class to be passed through into Log4J. In this case the logger class FQCN > will be "org.apache.commons.logging.impl.Log4JCategoryLog". This allows > Log4J to correctly identify the location in the code from which the logger > is being called, if required. Without this Log4J reports that the calling > location is ALWAYS Log4JCategoryLog.java:132. Revision Changes Path 1.3 +19 -17 jakarta-commons/logging/src/java/org/apache/commons/logging/impl/Log4JCategoryLog.java Index: Log4JCategoryLog.java =================================================================== RCS file: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/impl/Log4JCategoryLog.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Log4JCategoryLog.java 15 Feb 2002 03:54:19 -0000 1.2 +++ Log4JCategoryLog.java 7 Mar 2002 22:32:47 -0000 1.3 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/impl/Log4JCategoryLog.java,v 1.2 2002/02/15 03:54:19 costin Exp $ - * $Revision: 1.2 $ - * $Date: 2002/02/15 03:54:19 $ + * $Header: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/impl/Log4JCategoryLog.java,v 1.3 2002/03/07 22:32:47 costin Exp $ + * $Revision: 1.3 $ + * $Date: 2002/03/07 22:32:47 $ * * ==================================================================== * @@ -75,13 +75,16 @@ * @author Scott Sanders * @author Rod Waldhoff * @author Robert Burrell Donkin - * @version $Id: Log4JCategoryLog.java,v 1.2 2002/02/15 03:54:19 costin Exp $ + * @version $Id: Log4JCategoryLog.java,v 1.3 2002/03/07 22:32:47 costin Exp $ */ public final class Log4JCategoryLog implements Log { // ------------------------------------------------------------- Attributes + /** The fully qualified name of the Log4JCategoryLog class. */ + private static final String FQCN = Log4JCategoryLog.class.getName(); + /** Log to this category */ private Category category = null; @@ -112,7 +115,7 @@ * Currently logs to DEBUG level in Log4J. */ public void trace(Object message) { - category.debug(message); + category.log(FQCN, Priority.DEBUG, message, null); } @@ -121,7 +124,7 @@ * Currently logs to DEBUG level in Log4J. */ public void trace(Object message, Throwable t) { - category.debug(message,t); + category.log(FQCN, Priority.DEBUG, message, t ); } @@ -129,15 +132,14 @@ * Log a message to the Log4j Category with DEBUG priority. */ public void debug(Object message) { - category.debug(message); + category.log(FQCN, Priority.DEBUG, message, null); } - /** * Log an error to the Log4j Category with DEBUG priority. */ public void debug(Object message, Throwable t) { - category.debug(message,t); + category.log(FQCN, Priority.DEBUG, message, t ); } @@ -145,7 +147,7 @@ * Log a message to the Log4j Category with INFO priority. */ public void info(Object message) { - category.info(message); + category.log(FQCN, Priority.INFO, message, null ); } @@ -153,7 +155,7 @@ * Log an error to the Log4j Category with INFO priority. */ public void info(Object message, Throwable t) { - category.info(message,t); + category.log(FQCN, Priority.INFO, message, t ); } @@ -161,7 +163,7 @@ * Log a message to the Log4j Category with WARN priority. */ public void warn(Object message) { - category.warn(message); + category.log(FQCN, Priority.WARN, message, null ); } @@ -169,7 +171,7 @@ * Log an error to the Log4j Category with WARN priority. */ public void warn(Object message, Throwable t) { - category.warn(message,t); + category.log(FQCN, Priority.WARN, message, t ); } @@ -177,7 +179,7 @@ * Log a message to the Log4j Category with ERROR priority. */ public void error(Object message) { - category.error(message); + category.log(FQCN, Priority.ERROR, message, null ); } @@ -185,7 +187,7 @@ * Log an error to the Log4j Category with ERROR priority. */ public void error(Object message, Throwable t) { - category.error(message,t); + category.log(FQCN, Priority.ERROR, message, t ); } @@ -193,7 +195,7 @@ * Log a message to the Log4j Category with FATAL priority. */ public void fatal(Object message) { - category.fatal(message); + category.log(FQCN, Priority.FATAL, message, null ); } @@ -201,7 +203,7 @@ * Log an error to the Log4j Category with FATAL priority. */ public void fatal(Object message, Throwable t) { - category.fatal(message,t); + category.log(FQCN, Priority.FATAL, message, t ); } -- To unsubscribe, e-mail: For additional commands, e-mail: