You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by cr...@apache.org on 2002/11/23 04:49:40 UTC

cvs commit: jakarta-commons/logging/src/java/org/apache/commons/logging/impl Log4JCategoryLog.java Log4jFactory.java LogFactoryImpl.java

craigmcc    2002/11/22 19:49:40

  Modified:    logging/src/java/org/apache/commons/logging LogSource.java
                        package.html
               logging/src/java/org/apache/commons/logging/impl
                        Log4JCategoryLog.java Log4jFactory.java
                        LogFactoryImpl.java
  Log:
  Deprecte Log4JCategoryLog (because Log4J has deprecated o.a.l.Category),
  and replace it with a new Log4JLogger implementation that wraps an
  o.a.l.Logger instance instead.
  
  Update docco to reflect that Log4J support is now for version 1.2 or later
  (when o.a.l.Logger was introduced).
  
  PR:  13118
  Submitted by:  Paul Campbell <seapwc at halycon.com>
  
  Revision  Changes    Path
  1.16      +9 -9      jakarta-commons/logging/src/java/org/apache/commons/logging/LogSource.java
  
  Index: LogSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/LogSource.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- LogSource.java	15 Jun 2002 18:13:01 -0000	1.15
  +++ LogSource.java	23 Nov 2002 03:49:40 -0000	1.16
  @@ -77,7 +77,7 @@
    * algorithm:</p>
    * <ul>
    * <li>If Log4J is available, return an instance of
  - *     <code>org.apache.commons.logging.impl.Log4JCategoryLog</code>.</li>
  + *     <code>org.apache.commons.logging.impl.Log4JLogger</code>.</li>
    * <li>If JDK 1.4 or later is available, return an instance of
    *     <code>org.apache.commons.logging.impl.Jdk14Logger</code>.</li>
    * <li>Otherwise, return an instance of
  @@ -121,7 +121,7 @@
   
           // Is Log4J Available?
           try {
  -            if (null != Class.forName("org.apache.log4j.Category")) {
  +            if (null != Class.forName("org.apache.log4j.Logger")) {
                   log4jIsAvailable = true;
               } else {
                   log4jIsAvailable = false;
  @@ -166,7 +166,7 @@
               try {
                   if (log4jIsAvailable) {
                       setLogImplementation
  -                            ("org.apache.commons.logging.impl.Log4JCategoryLog");
  +                            ("org.apache.commons.logging.impl.Log4JLogger");
                   } else if (jdk14IsAvailable) {
                       setLogImplementation
                               ("org.apache.commons.logging.impl.Jdk14Logger");
  @@ -268,8 +268,8 @@
        * <p>
        * When <tt>org.apache.commons.logging.log</tt> is not set,
        * or when no corresponding class can be found,
  -     * this method will return a Log4JCategoryLog
  -     * if the log4j Category class is
  +     * this method will return a Log4JLogger
  +     * if the log4j Logger class is
        * available in the {@link LogSource}'s classpath, or a
        * Jdk14Logger if we are on a JDK 1.4 or later system, or
        * NoOpLog if neither of the above conditions is true.
  
  
  
  1.8       +4 -4      jakarta-commons/logging/src/java/org/apache/commons/logging/package.html
  
  Index: package.html
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/package.html,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- package.html	23 Nov 2002 03:07:58 -0000	1.7
  +++ package.html	23 Nov 2002 03:49:40 -0000	1.8
  @@ -7,9 +7,9 @@
   can be used around a variety of different logging implementations, including
   prebuilt support for the following:</p>
   <ul>
  -<li><a href="http://jakarta.apache.org/log4j/">Log4J</a> from Apache's
  -    Jakarta project.  Each named <a href="Log.html">Log</a> instance is
  -    connected to a corresponding Log4J Category.</li>
  +<li><a href="http://jakarta.apache.org/log4j/">Log4J</a> (version 1.2 or later)
  +    from Apache's Jakarta project.  Each named <a href="Log.html">Log</a>
  +    instance is connected to a corresponding Log4J Logger.</li>
   <li><a href="http://java.sun.com/j2se/1.4/docs/guide/util/logging/index.html">
       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
  @@ -127,7 +127,7 @@
           <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/Log4JCategoryLog.html">Log4JCategoryLog</a>).</li>
  +        (<a href="impl/Log4JLogger.html">Log4JLogger</a>).</li>
       <li>If the application is executing on a JDK 1.4 system, use
           the corresponding wrapper class
           (<a href="impl/Jdk14Logger.html">Jdk14Logger</a>).</li>
  
  
  
  1.8       +6 -4      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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Log4JCategoryLog.java	23 Nov 2002 03:25:33 -0000	1.7
  +++ Log4JCategoryLog.java	23 Nov 2002 03:49:40 -0000	1.8
  @@ -72,6 +72,8 @@
    * Category instances should be done in the usual manner, as outlined in
    * the Log4J documentation.</p>
    *
  + * @deprecated Use {@link Log4JLogger} instead.
  + *
    * @author <a href="mailto:sanders@apache.org">Scott Sanders</a>
    * @author Rod Waldhoff
    * @author Robert Burrell Donkin
  
  
  
  1.2       +3 -3      jakarta-commons/logging/src/java/org/apache/commons/logging/impl/Log4jFactory.java
  
  Index: Log4jFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/impl/Log4jFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Log4jFactory.java	15 Feb 2002 03:53:39 -0000	1.1
  +++ Log4jFactory.java	23 Nov 2002 03:49:40 -0000	1.2
  @@ -68,7 +68,7 @@
   import org.apache.commons.logging.LogFactory;
   import org.apache.commons.logging.LogSource;
   
  -import org.apache.log4j.Category;
  +import org.apache.log4j.Logger;
   
   /**
    * <p>Concrete subclass of {@link LogFactory} specific to log4j.
  @@ -137,7 +137,7 @@
           if( instance != null )
               return instance;
   
  -        instance=new Log4JCategoryLog( Category.getInstance( clazz ));
  +        instance=new Log4JLogger( Logger.getLogger( clazz ));
           instances.put( clazz, instance );
           return instance;
       }
  @@ -150,7 +150,7 @@
           if( instance != null )
               return instance;
   
  -        instance=new Log4JCategoryLog( Category.getInstance( name ));
  +        instance=new Log4JLogger( Logger.getLogger( name ));
           instances.put( name, instance );
           return instance;
       }
  
  
  
  1.20      +8 -8      jakarta-commons/logging/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java
  
  Index: LogFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- LogFactoryImpl.java	23 Nov 2002 03:07:58 -0000	1.19
  +++ LogFactoryImpl.java	23 Nov 2002 03:49:40 -0000	1.20
  @@ -86,7 +86,7 @@
    * <li>Use the <code>org.apache.commons.logging.Log</code> system property
    *     to identify the requested implementation class.</li>
    * <li>If <em>Log4J</em> is available, return an instance of
  - *     <code>org.apache.commons.logging.impl.Log4JCategoryLog</code>.</li>
  + *     <code>org.apache.commons.logging.impl.Log4JLogger</code>.</li>
    * <li>If <em>JDK 1.4 or later</em> is available, return an instance of
    *     <code>org.apache.commons.logging.impl.Jdk14Logger</code>.</li>
    * <li>Otherwise, return an instance of
  @@ -154,7 +154,7 @@
   
   
       private static final String LOG4JLOGIMPL =
  -        "org.apache.commons.logging.impl.Log4JCategoryLog".intern();
  +        "org.apache.commons.logging.impl.Log4JLogger".intern();
   
       // ----------------------------------------------------- Instance Variables
   
  @@ -534,8 +534,8 @@
       protected boolean isLog4JAvailable() {
   
           try {
  -            loadClass("org.apache.log4j.Category");
  -            loadClass("org.apache.commons.logging.impl.Log4JCategoryLog");
  +            loadClass("org.apache.log4j.Logger");
  +            loadClass("org.apache.commons.logging.impl.Log4JLogger");
               return (true);
           } catch (Throwable t) {
               return (false);
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>