Cosmetic changes, and correct copyright dates. Add simple overview
with pointer to the real documentation, and a package.html for the o.a.c.l.impl package. Bring various documentation points up to date with the actual current functionality. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138961 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/Log.java,v 1.13 2002/06/15 18:13:01 craigmcc Exp $
|
||||
* $Revision: 1.13 $
|
||||
* $Date: 2002/06/15 18:13:01 $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/Log.java,v 1.14 2003/03/30 23:42:36 craigmcc Exp $
|
||||
* $Revision: 1.14 $
|
||||
* $Date: 2003/03/30 23:42:36 $
|
||||
*
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
*
|
||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
||||
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -64,7 +64,7 @@ package org.apache.commons.logging;
|
||||
|
||||
/**
|
||||
* <p>A simple logging interface abstracting logging APIs. In order to be
|
||||
* instantiated successfully by {@link LogSource}, classes that implement
|
||||
* instantiated successfully by {@link LogFactory}, classes that implement
|
||||
* this interface must have a constructor that takes a single String
|
||||
* parameter representing the "name" of this Log.</p>
|
||||
*
|
||||
@@ -102,7 +102,7 @@ package org.apache.commons.logging;
|
||||
*
|
||||
* @author <a href="mailto:sanders@apache.org">Scott Sanders</a>
|
||||
* @author Rod Waldhoff
|
||||
* @version $Id: Log.java,v 1.13 2002/06/15 18:13:01 craigmcc Exp $
|
||||
* @version $Id: Log.java,v 1.14 2003/03/30 23:42:36 craigmcc Exp $
|
||||
*/
|
||||
public interface Log {
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/LogConfigurationException.java,v 1.1 2002/02/13 02:18:30 craigmcc Exp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002/02/13 02:18:30 $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/LogConfigurationException.java,v 1.2 2003/03/30 23:42:36 craigmcc Exp $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2003/03/30 23:42:36 $
|
||||
*
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
*
|
||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
||||
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -68,7 +68,7 @@ package org.apache.commons.logging;
|
||||
* factory methods.</p>
|
||||
*
|
||||
* @author Craig R. McClanahan
|
||||
* @version $Revision: 1.1 $ $Date: 2002/02/13 02:18:30 $
|
||||
* @version $Revision: 1.2 $ $Date: 2003/03/30 23:42:36 $
|
||||
*/
|
||||
|
||||
public class LogConfigurationException extends RuntimeException {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/LogFactory.java,v 1.20 2003/03/01 09:55:06 baliuka Exp $
|
||||
* $Revision: 1.20 $
|
||||
* $Date: 2003/03/01 09:55:06 $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/LogFactory.java,v 1.21 2003/03/30 23:42:36 craigmcc Exp $
|
||||
* $Revision: 1.21 $
|
||||
* $Date: 2003/03/30 23:42:36 $
|
||||
*
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
*
|
||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
||||
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -87,7 +87,7 @@ import java.util.Properties;
|
||||
* @author Craig R. McClanahan
|
||||
* @author Costin Manolache
|
||||
* @author Richard A. Sitze
|
||||
* @version $Revision: 1.20 $ $Date: 2003/03/01 09:55:06 $
|
||||
* @version $Revision: 1.21 $ $Date: 2003/03/30 23:42:36 $
|
||||
*/
|
||||
|
||||
public abstract class LogFactory {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/LogSource.java,v 1.16 2002/11/23 03:49:40 craigmcc Exp $
|
||||
* $Revision: 1.16 $
|
||||
* $Date: 2002/11/23 03:49:40 $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/LogSource.java,v 1.17 2003/03/30 23:42:36 craigmcc Exp $
|
||||
* $Revision: 1.17 $
|
||||
* $Date: 2003/03/30 23:42:36 $
|
||||
*
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
*
|
||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
||||
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -97,7 +97,7 @@ import org.apache.commons.logging.impl.NoOpLog;
|
||||
* implementation performs exactly the same algorithm as this class did
|
||||
*
|
||||
* @author Rod Waldhoff
|
||||
* @version $Id: LogSource.java,v 1.16 2002/11/23 03:49:40 craigmcc Exp $
|
||||
* @version $Id: LogSource.java,v 1.17 2003/03/30 23:42:36 craigmcc Exp $
|
||||
*/
|
||||
public class LogSource {
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/impl/Jdk14Logger.java,v 1.4 2002/07/17 16:42:40 rsitze Exp $
|
||||
* $Revision: 1.4 $
|
||||
* $Date: 2002/07/17 16:42:40 $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/impl/Jdk14Logger.java,v 1.5 2003/03/30 23:42:36 craigmcc Exp $
|
||||
* $Revision: 1.5 $
|
||||
* $Date: 2003/03/30 23:42:36 $
|
||||
*
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
*
|
||||
* Copyright (c) 1999-2001 The Apache Software Foundation. All rights
|
||||
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -77,7 +77,7 @@ import org.apache.commons.logging.Log;
|
||||
* @author <a href="mailto:sanders@apache.org">Scott Sanders</a>
|
||||
* @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
|
||||
* @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
|
||||
* @version $Revision: 1.4 $ $Date: 2002/07/17 16:42:40 $
|
||||
* @version $Revision: 1.5 $ $Date: 2003/03/30 23:42:36 $
|
||||
*/
|
||||
|
||||
public final class Jdk14Logger implements Log {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/impl/Attic/Log4JCategoryLog.java,v 1.8 2002/11/23 03:49:40 craigmcc Exp $
|
||||
* $Revision: 1.8 $
|
||||
* $Date: 2002/11/23 03:49:40 $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/impl/Attic/Log4JCategoryLog.java,v 1.9 2003/03/30 23:42:36 craigmcc Exp $
|
||||
* $Revision: 1.9 $
|
||||
* $Date: 2003/03/30 23:42:36 $
|
||||
*
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
*
|
||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
||||
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -77,7 +77,7 @@ import java.util.Enumeration;
|
||||
* @author <a href="mailto:sanders@apache.org">Scott Sanders</a>
|
||||
* @author Rod Waldhoff
|
||||
* @author Robert Burrell Donkin
|
||||
* @version $Id: Log4JCategoryLog.java,v 1.8 2002/11/23 03:49:40 craigmcc Exp $
|
||||
* @version $Id: Log4JCategoryLog.java,v 1.9 2003/03/30 23:42:36 craigmcc Exp $
|
||||
*/
|
||||
public final class Log4JCategoryLog implements Log {
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/impl/Log4JLogger.java,v 1.1 2002/11/23 03:50:13 craigmcc Exp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002/11/23 03:50:13 $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/impl/Log4JLogger.java,v 1.2 2003/03/30 23:42:36 craigmcc Exp $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2003/03/30 23:42:36 $
|
||||
*
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
*
|
||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
||||
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -75,7 +75,7 @@ import java.util.Enumeration;
|
||||
* @author <a href="mailto:sanders@apache.org">Scott Sanders</a>
|
||||
* @author Rod Waldhoff
|
||||
* @author Robert Burrell Donkin
|
||||
* @version $Id: Log4JLogger.java,v 1.1 2002/11/23 03:50:13 craigmcc Exp $
|
||||
* @version $Id: Log4JLogger.java,v 1.2 2003/03/30 23:42:36 craigmcc Exp $
|
||||
*/
|
||||
public final class Log4JLogger implements Log {
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
*
|
||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
||||
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java,v 1.23 2003/03/29 18:31:17 craigmcc Exp $
|
||||
* $Revision: 1.23 $
|
||||
* $Date: 2003/03/29 18:31:17 $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java,v 1.24 2003/03/30 23:42:36 craigmcc Exp $
|
||||
* $Revision: 1.24 $
|
||||
* $Date: 2003/03/30 23:42:36 $
|
||||
*
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
*
|
||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
||||
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -107,7 +107,7 @@ import org.apache.commons.logging.LogFactory;
|
||||
* @author Rod Waldhoff
|
||||
* @author Craig R. McClanahan
|
||||
* @author Richard A. Sitze
|
||||
* @version $Revision: 1.23 $ $Date: 2003/03/29 18:31:17 $
|
||||
* @version $Revision: 1.24 $ $Date: 2003/03/30 23:42:36 $
|
||||
*/
|
||||
|
||||
public class LogFactoryImpl extends LogFactory {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/impl/LogKitLogger.java,v 1.2 2002/07/17 16:42:40 rsitze Exp $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2002/07/17 16:42:40 $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/impl/LogKitLogger.java,v 1.3 2003/03/30 23:42:36 craigmcc Exp $
|
||||
* $Revision: 1.3 $
|
||||
* $Date: 2003/03/30 23:42:36 $
|
||||
*
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
*
|
||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
||||
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -68,8 +68,9 @@ import org.apache.commons.logging.Log;
|
||||
|
||||
/**
|
||||
* <p>Implementation of <code>org.apache.commons.logging.Log</code>
|
||||
* that wraps the <a href="http://jakarta.apache.org/avalon/logkit/">jakarta-avalon-logkit</a>
|
||||
* logging system. Configuration of <code>LogKit</code> is left to the user.</p>
|
||||
* that wraps the <a href="http://avalon.apache.org/logkit/">avalon-logkit</a>
|
||||
* logging system. Configuration of <code>LogKit</code> is left to the user.
|
||||
* </p>
|
||||
*
|
||||
* <p><code>LogKit</code> accepts only <code>String</code> messages.
|
||||
* Therefore, this implementation converts object messages into strings
|
||||
@@ -77,7 +78,7 @@ import org.apache.commons.logging.Log;
|
||||
*
|
||||
* @author <a href="mailto:sanders@apache.org">Scott Sanders</a>
|
||||
* @author Robert Burrell Donkin *
|
||||
* @version $Id: LogKitLogger.java,v 1.2 2002/07/17 16:42:40 rsitze Exp $
|
||||
* @version $Id: LogKitLogger.java,v 1.3 2003/03/30 23:42:36 craigmcc Exp $
|
||||
*/
|
||||
|
||||
public final class LogKitLogger implements Log {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/impl/NoOpLog.java,v 1.1 2002/02/03 01:31:29 sanders Exp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002/02/03 01:31:29 $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/impl/NoOpLog.java,v 1.2 2003/03/30 23:42:36 craigmcc Exp $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2003/03/30 23:42:36 $
|
||||
*
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
*
|
||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
||||
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -67,12 +67,12 @@ import org.apache.commons.logging.Log;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Default implementation of Log that throws away all messages. No
|
||||
* <p>Trivial implementation of Log that throws away all messages. No
|
||||
* configurable system properties are supported.</p>
|
||||
*
|
||||
* @author <a href="mailto:sanders@apache.org">Scott Sanders</a>
|
||||
* @author Rod Waldhoff
|
||||
* @version $Id: NoOpLog.java,v 1.1 2002/02/03 01:31:29 sanders Exp $
|
||||
* @version $Id: NoOpLog.java,v 1.2 2003/03/30 23:42:36 craigmcc Exp $
|
||||
*/
|
||||
public final class NoOpLog implements Log {
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/impl/SimpleLog.java,v 1.8 2002/12/12 20:29:16 rsitze Exp $
|
||||
* $Revision: 1.8 $
|
||||
* $Date: 2002/12/12 20:29:16 $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/impl/SimpleLog.java,v 1.9 2003/03/30 23:42:36 craigmcc Exp $
|
||||
* $Revision: 1.9 $
|
||||
* $Date: 2003/03/30 23:42:36 $
|
||||
*
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
*
|
||||
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
||||
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -90,10 +90,10 @@ import org.apache.commons.logging.LogConfigurationException;
|
||||
* If not specified, the default logging detail level is used.</li>
|
||||
* <li><code>org.apache.commons.logging.simplelog.showlogname</code> -
|
||||
* Set to <code>true</code> if you want the Log instance name to be
|
||||
* included in output messages. Defaults to false</li>
|
||||
* included in output messages. Defaults to <code>false</code>.</li>
|
||||
* <li><code>org.apache.commons.logging.simplelog.showShortLogname</code> -
|
||||
* Set to <code>true</code> if you want the last componet of the name to be
|
||||
* included in output messages. Defaults to true.</li>
|
||||
* included in output messages. Defaults to <code>true</code>.</li>
|
||||
* <li><code>org.apache.commons.logging.simplelog.showdatetime</code> -
|
||||
* Set to <code>true</code> if you want the current date and time
|
||||
* to be included in output messages. Default is false.</li>
|
||||
@@ -108,7 +108,7 @@ import org.apache.commons.logging.LogConfigurationException;
|
||||
* @author Rod Waldhoff
|
||||
* @author Robert Burrell Donkin
|
||||
*
|
||||
* @version $Id: SimpleLog.java,v 1.8 2002/12/12 20:29:16 rsitze Exp $
|
||||
* @version $Id: SimpleLog.java,v 1.9 2003/03/30 23:42:36 craigmcc Exp $
|
||||
*/
|
||||
public class SimpleLog implements Log {
|
||||
|
||||
|
||||
3
src/java/org/apache/commons/logging/impl/package.html
Normal file
3
src/java/org/apache/commons/logging/impl/package.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<body>
|
||||
<p>Concrete implementations of commons-logging wrapper APIs.</p>
|
||||
</body>
|
||||
@@ -1,6 +1,7 @@
|
||||
<body>
|
||||
<p>Simple wrapper API around multiple logging APIs.</p>
|
||||
|
||||
|
||||
<h3>Overview</h3>
|
||||
|
||||
<p>This package provides an API for logging in server-based applications that
|
||||
@@ -14,14 +15,14 @@ prebuilt support for the following:</p>
|
||||
JDK Logging API</a>, included in JDK 1.4 or later systems. Each named
|
||||
<a href="Log.html">Log</a> instance is connected to a corresponding
|
||||
<code>java.util.logging.Logger</code> instance.</li>
|
||||
<li><a href="http://jakarta.apache.org/avalon/">LogKit</a> from Apache's
|
||||
Jakarta project. Each named <a href="Log.html">Log</a> instance is
|
||||
<li><a href="http://avalong.apache.org/logkit/">LogKit</a> from Apache's
|
||||
Avalon project. Each named <a href="Log.html">Log</a> instance is
|
||||
connected to a corresponding LogKit <code>Logger</code>.</li>
|
||||
<li><a href="impl/NoOpLog.html">NoOpLog</a> implementation that simply swallows
|
||||
all log output, for all named <a href="Log.html">Log</a> isntances.</li>
|
||||
<li><a href="impl/SimpleLog.html">SimpleLog</a> implementation that writes all
|
||||
log output, for all named <a href="Log.html">Log</a> instances, to
|
||||
System.out.</li>
|
||||
System.err.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -37,7 +38,7 @@ convention) after the calling class:
|
||||
|
||||
public class Foo {
|
||||
|
||||
Log log = LogFactory.getLog(this.class);
|
||||
static Log log = LogFactory.getLog(this.class);
|
||||
|
||||
public void foo() {
|
||||
...
|
||||
@@ -53,9 +54,10 @@ convention) after the calling class:
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>Unless you configure things differently, all log output will be thrown
|
||||
away. Therefore, you really will want to review the remainder of this page
|
||||
in order to understand how to configure logging for your application.</p>
|
||||
<p>Unless you configure things differently, all log output will be written
|
||||
to System.err. Therefore, you really will want to review the remainder of
|
||||
this page in order to understand how to configure logging for your
|
||||
application.</p>
|
||||
|
||||
|
||||
<h3>Configuring the Commons Logging Package</h3>
|
||||
@@ -65,11 +67,11 @@ in order to understand how to configure logging for your application.</p>
|
||||
|
||||
<p>From an application perspective, the first requirement is to retrieve an
|
||||
object reference to the <code>LogFactory</code> instance that will be used
|
||||
to create <code><a href="Log.html">Log</a></code> instances for this application.
|
||||
This is normally accomplished by calling the static <code>getFactory()</code>
|
||||
method. This method implements the following discovery algorithm to select
|
||||
the name of the <code>LogFactory</code> implementation class this application
|
||||
wants to use:</p>
|
||||
to create <code><a href="Log.html">Log</a></code> instances for this
|
||||
application. This is normally accomplished by calling the static
|
||||
<code>getFactory()</code> method. This method implements the following
|
||||
discovery algorithm to select the name of the <code>LogFactory</code>
|
||||
implementation class this application wants to use:</p>
|
||||
<ul>
|
||||
<li>Check for a system property named
|
||||
<code>org.apache.commons.logging.LogFactory</code>.</li>
|
||||
@@ -98,7 +100,7 @@ otherwise. This allows a copy of <code>commons-logging.jar</code> to be
|
||||
shared in a multiple class loader environment (such as a servlet container),
|
||||
but still allow each web application to provide its own <code>LogFactory</code>
|
||||
implementation, if it so desires. An instance of this class will then be
|
||||
created, and
|
||||
created, and cached per class loader.
|
||||
|
||||
|
||||
<h4>The Default <code>LogFactory</code> Implementation</h4>
|
||||
@@ -119,12 +121,14 @@ implementation uses the following rules:</p>
|
||||
<code>LogFactory</code> implementation uses the following discovery
|
||||
process is used:
|
||||
<ul>
|
||||
<li>Look for a configuration attribute of this factory named
|
||||
<code>org.apache.commons.logging.Log</code> (for backwards
|
||||
compatibility to pre-1.0 versions of this API, an attribute
|
||||
<code>org.apache.commons.logging.log is also consulted)..</li>
|
||||
<li>Look for a system property named
|
||||
<code>org.apache.commons.logging.Log</code> (for backwards
|
||||
compatibility to pre-1.0 versions of this API, a system property
|
||||
<code>org.apache.commons.logging.log</code> is also consulted).</li>
|
||||
<li>Look for a configuration attribute of this factory named
|
||||
<code>org.apache.commons.logging.Log</code>.</li>
|
||||
<li>If the Log4J logging system is available in the application
|
||||
class path, use the corresponding wrapper class
|
||||
(<a href="impl/Log4JLogger.html">Log4JLogger</a>).</li>
|
||||
@@ -142,20 +146,8 @@ implementation uses the following rules:</p>
|
||||
argument to its constructor.</li>
|
||||
</ul>
|
||||
|
||||
<p>If you wish to receive logging output to <code>System.out</code>, but have
|
||||
not installed one of the three supported logging packages, a simple
|
||||
<code>Log</code> implementation named <a href="impl/SimpleLog.html">
|
||||
SimpleLog</a> is available. You can select it, based on the above rules,
|
||||
by including a system property definition on the command line that starts
|
||||
your application:</p>
|
||||
<pre>
|
||||
java \
|
||||
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog \
|
||||
MyApplication
|
||||
</pre>
|
||||
|
||||
<p>See the <a href="impl/SimpleLog.html">SimpleLog</a> JavaDocs for detailed
|
||||
configuration information for this implementation.</p>
|
||||
configuration information for this default implementation.</p>
|
||||
|
||||
|
||||
<h4>Configuring the Underlying Logging System</h4>
|
||||
@@ -192,6 +184,16 @@ component, consists of the following steps:</p>
|
||||
<code>warn()</code>, <code>error</code>, and <code>fatal()</code>).</li>
|
||||
</ol>
|
||||
|
||||
<p>For convenience, <code>LogFactory</code> also offers a static method
|
||||
<code>getLog()</code> that combines the typical two-step pattern:</p>
|
||||
<pre>
|
||||
Log log = LogFactory.getFactory().getInstance("Foo");
|
||||
</pre>
|
||||
<p>into a single method call:</p>
|
||||
<pre>
|
||||
Log log = LogFactory.getLog("Foo");
|
||||
</pre>
|
||||
|
||||
<p>For example, you might use the following technique to initialize and
|
||||
use a <a href="Log.html">Log</a> instance in an application component:</p>
|
||||
<pre>
|
||||
@@ -200,7 +202,8 @@ import org.apache.commons.logging.LogFactory;
|
||||
|
||||
public class MyComponent {
|
||||
|
||||
protected Log log = LogFactory.getLog("my.component");
|
||||
protected static Log log =
|
||||
LogFactory.getLog("my.component");
|
||||
|
||||
// Called once at startup time
|
||||
public void start() {
|
||||
|
||||
16
src/java/overview.html
Normal file
16
src/java/overview.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Overview Documentation for COMMONS-LOGGING</title>
|
||||
</head>
|
||||
<body bgcolor="white">
|
||||
<p>The <em>Logging Wrapper Library</em> component of the Jakarta Commons
|
||||
subproject offers wrappers around an extensible set of concrete logging
|
||||
implementations, so that application code based on it does not need to be
|
||||
modified in order to select a different logging implementation.</p>
|
||||
|
||||
<p>See the
|
||||
<a href="org/apache/commons/logging/package-summary.html#package_description">
|
||||
Package Description</a> for the <code>org.apache.commons.logging</code>
|
||||
package for more information.</p>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user