avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/logger/src/java/org/apache/avalon/excalibur/logger Log4JLoggerManager.java
Date Mon, 14 Oct 2002 12:48:19 GMT
donaldp     2002/10/14 05:48:19

  Modified:    logger/src/java/org/apache/avalon/excalibur/logger
                        Log4JLoggerManager.java
  Log:
  Fix to work with latest Log4j
  
  Submitted By: Ceki Gülcü <ceki@qos.ch>
  
  Revision  Changes    Path
  1.7       +17 -13    jakarta-avalon-excalibur/logger/src/java/org/apache/avalon/excalibur/logger/Log4JLoggerManager.java
  
  Index: Log4JLoggerManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/logger/src/java/org/apache/avalon/excalibur/logger/Log4JLoggerManager.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Log4JLoggerManager.java	6 Oct 2002 11:22:18 -0000	1.6
  +++ Log4JLoggerManager.java	14 Oct 2002 12:48:19 -0000	1.7
  @@ -54,8 +54,8 @@
   import org.apache.avalon.framework.logger.Log4JLogger;
   import org.apache.avalon.framework.logger.LogEnabled;
   import org.apache.avalon.framework.logger.Logger;
  -import org.apache.log4j.Category;
  -import org.apache.log4j.Hierarchy;
  +import org.apache.log4j.LogManager;
  +import org.apache.log4j.spi.LoggerRepository;
   
   /**
    * Log4JLoggerManager implementation.  This is the interface used to get instances of
  @@ -76,7 +76,7 @@
       private String m_prefix;
   
       /** The hierarchy private to Log4JManager */
  -    private Hierarchy m_hierarchy;
  +    private LoggerRepository m_hierarchy;
   
       /** The default logger used for this system */
       private final Logger m_defaultLogger;
  @@ -89,13 +89,13 @@
        */
       public Log4JLoggerManager()
       {
  -        this( Category.getDefaultHierarchy() );
  +        this( LogManager.getLoggerRepository() );
       }
   
       /**
        * Creates a new <code>DefaultLog4JManager</code> with an existing <code>Hierarchy</code>.
        */
  -    public Log4JLoggerManager( final Hierarchy hierarchy )
  +    public Log4JLoggerManager( final LoggerRepository hierarchy )
       {
           this( null, hierarchy );
       }
  @@ -106,24 +106,26 @@
        */
       public Log4JLoggerManager( final String prefix )
       {
  -        this( prefix, Category.getDefaultHierarchy() );
  +        this( prefix, LogManager.getLoggerRepository() );
       }
   
       /**
        * Creates a new <code>DefaultLog4JManager</code> with an existing <code>Hierarchy</code>
using
        * specified logger name as root logger.
        */
  -    public Log4JLoggerManager( final String prefix, final Hierarchy hierarchy )
  +    public Log4JLoggerManager( final String prefix,
  +                               final LoggerRepository hierarchy )
       {
           this( prefix, hierarchy,
  -              new Log4JLogger( hierarchy.getInstance( "" ) ) );
  +              new Log4JLogger( hierarchy.getLogger( "" ) ) );
       }
   
       /**
        * Creates a new <code>DefaultLog4JManager</code> with an existing <code>Hierarchy</code>
using
        * specified logger name as root logger.
        */
  -    public Log4JLoggerManager( final String prefix, final Hierarchy hierarchy,
  +    public Log4JLoggerManager( final String prefix,
  +                               final LoggerRepository hierarchy,
                                  final Logger defaultLogger )
       {
           this( prefix, hierarchy, defaultLogger, defaultLogger );
  @@ -133,8 +135,10 @@
        * Creates a new <code>DefaultLog4JManager</code> with an existing <code>Hierarchy</code>
using
        * specified logger name as root logger.
        */
  -    public Log4JLoggerManager( final String prefix, final Hierarchy hierarchy,
  -                               final Logger defaultLogger, final Logger logger )
  +    public Log4JLoggerManager( final String prefix,
  +                               final LoggerRepository hierarchy,
  +                               final Logger defaultLogger,
  +                               final Logger logger )
       {
           m_prefix = prefix;
           m_hierarchy = hierarchy;
  @@ -180,7 +184,7 @@
                               + " not defined in configuration. New Logger created and returned"
);
           }
   
  -        logger = new Log4JLogger( m_hierarchy.getInstance( categoryName ) );
  +        logger = new Log4JLogger( m_hierarchy.getLogger( categoryName ) );
           m_loggers.put( categoryName, logger );
           return logger;
       }
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message