You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by co...@apache.org on 2002/06/07 02:22:54 UTC

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

costin      2002/06/06 17:22:54

  Modified:    logging/src/java/org/apache/commons/logging/impl
                        Log4JCategoryLog.java
  Log:
  Make sure we are initialized for all constructors. Change the name of the
  default appender.
  
  I still have some problems with log4j's JMX if I construct the logger
  via API ( i.e. no log4j.properties ) - but that shouldn't affect too
  many people, so I'll leave it.
  
  Revision  Changes    Path
  1.6       +15 -6     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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Log4JCategoryLog.java	6 Jun 2002 22:09:09 -0000	1.5
  +++ Log4JCategoryLog.java	7 Jun 2002 00:22:54 -0000	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/impl/Log4JCategoryLog.java,v 1.5 2002/06/06 22:09:09 costin Exp $
  - * $Revision: 1.5 $
  - * $Date: 2002/06/06 22:09:09 $
  + * $Header: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/impl/Log4JCategoryLog.java,v 1.6 2002/06/07 00:22:54 costin Exp $
  + * $Revision: 1.6 $
  + * $Date: 2002/06/07 00:22:54 $
    *
    * ====================================================================
    *
  @@ -75,7 +75,7 @@
    * @author <a href="mailto:sanders@apache.org">Scott Sanders</a>
    * @author Rod Waldhoff
    * @author Robert Burrell Donkin
  - * @version $Id: Log4JCategoryLog.java,v 1.5 2002/06/06 22:09:09 costin Exp $
  + * @version $Id: Log4JCategoryLog.java,v 1.6 2002/06/07 00:22:54 costin Exp $
    */
   public final class Log4JCategoryLog implements Log {
   
  @@ -94,12 +94,21 @@
   
       // ------------------------------------------------------------ Constructor
   
  +    public Log4JCategoryLog() {
  +        if( ! initialized ) {
  +            initialize();
  +        }
  +    }
  +
   
       /**
        * Base constructor
        */
       public Log4JCategoryLog(String name) {
  -        this( Category.getInstance(name));
  +        if( ! initialized ) {
  +            initialize();
  +        }
  +        this.category=Category.getInstance(name);
       }
   
       /** For use with a log4j factory
  @@ -122,7 +131,7 @@
               // commons-logging patterns ).
               ConsoleAppender app=new ConsoleAppender(new PatternLayout( LAYOUT ),
                                                       ConsoleAppender.SYSTEM_ERR );
  -            app.setName("stderr");
  +            app.setName("commons-logging");
               
               root.addAppender( app );
               root.setPriority( Priority.INFO );
  
  
  

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