org.apache.avalon.excalibur.logger
Class Log4JLoggerManager

java.lang.Object
  extended byorg.apache.avalon.excalibur.logger.AbstractLoggerManager
      extended byorg.apache.avalon.excalibur.logger.Log4JLoggerManager
All Implemented Interfaces:
LogEnabled, LoggerManager
Direct Known Subclasses:
Log4JConfLoggerManager

public class Log4JLoggerManager
extends AbstractLoggerManager
implements LoggerManager

Log4JLoggerManager implementation. This is the interface used to get instances of a Logger for your system. This manager does not set up the categories--it leaves that as an excercise for Log4J's construction.

Since:
4.1
Version:
CVS $Revision: 1.21 $ $Date: 2004/05/04 13:08:00 $
Author:
Avalon Development Team

Field Summary
 
Fields inherited from class org.apache.avalon.excalibur.logger.AbstractLoggerManager
m_loggers, m_prefix
 
Fields inherited from interface org.apache.avalon.excalibur.logger.LoggerManager
ROLE
 
Constructor Summary
Log4JLoggerManager()
          Creates a new DefaultLog4JManager.
Log4JLoggerManager(org.apache.log4j.spi.LoggerRepository hierarchy)
          Creates a new DefaultLog4JManager with an existing Hierarchy.
Log4JLoggerManager(java.lang.String prefix)
          Creates a new DefaultLog4JManager using specified logger name as root logger.
Log4JLoggerManager(java.lang.String prefix, org.apache.log4j.spi.LoggerRepository hierarchy)
          Creates a new DefaultLog4JManager with an existing Hierarchy using specified logger name as root logger.
Log4JLoggerManager(java.lang.String prefix, org.apache.log4j.spi.LoggerRepository hierarchy, Logger defaultLogger)
          Creates a new DefaultLog4JManager with an existing Hierarchy using specified logger name as root logger.
Log4JLoggerManager(java.lang.String prefix, org.apache.log4j.spi.LoggerRepository hierarchy, Logger defaultLogger, Logger logger)
          Creates a new DefaultLog4JManager with an existing Hierarchy using specified logger name as root logger.
Log4JLoggerManager(java.lang.String prefix, org.apache.log4j.spi.LoggerRepository hierarchy, java.lang.String switchToCategory)
          Creates a new DefaultLog4JManager with an existing Hierarchy using specified logger name as root logger.
Log4JLoggerManager(java.lang.String prefix, org.apache.log4j.spi.LoggerRepository hierarchy, java.lang.String switchToCategory, Logger defaultLogger, Logger logger)
          Creates a new DefaultLog4JManager.
Log4JLoggerManager(java.lang.String prefix, java.lang.String switchToCategory)
          Creates a new DefaultLog4JManager using specified logger name as root logger.
 
Method Summary
protected  Logger doGetLoggerForCategory(java.lang.String fullCategoryName)
          Actually create a logger wrapping underlying logger backed implementation for a give category.
 
Methods inherited from class org.apache.avalon.excalibur.logger.AbstractLoggerManager
enableLogging, getDefaultLogger, getLogger, getLoggerForCategory, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.avalon.excalibur.logger.LoggerManager
getDefaultLogger, getLoggerForCategory
 

Constructor Detail

Log4JLoggerManager

public Log4JLoggerManager()
Creates a new DefaultLog4JManager. It will use a new Hierarchy.


Log4JLoggerManager

public Log4JLoggerManager(org.apache.log4j.spi.LoggerRepository hierarchy)
Creates a new DefaultLog4JManager with an existing Hierarchy.


Log4JLoggerManager

public Log4JLoggerManager(java.lang.String prefix)
Creates a new DefaultLog4JManager using specified logger name as root logger.


Log4JLoggerManager

public Log4JLoggerManager(java.lang.String prefix,
                          org.apache.log4j.spi.LoggerRepository hierarchy)
Creates a new DefaultLog4JManager with an existing Hierarchy using specified logger name as root logger.


Log4JLoggerManager

public Log4JLoggerManager(java.lang.String prefix,
                          java.lang.String switchToCategory)
Creates a new DefaultLog4JManager using specified logger name as root logger.


Log4JLoggerManager

public Log4JLoggerManager(java.lang.String prefix,
                          org.apache.log4j.spi.LoggerRepository hierarchy,
                          java.lang.String switchToCategory)
Creates a new DefaultLog4JManager with an existing Hierarchy using specified logger name as root logger.


Log4JLoggerManager

public Log4JLoggerManager(java.lang.String prefix,
                          org.apache.log4j.spi.LoggerRepository hierarchy,
                          Logger defaultLogger)
Creates a new DefaultLog4JManager with an existing Hierarchy using specified logger name as root logger.


Log4JLoggerManager

public Log4JLoggerManager(java.lang.String prefix,
                          org.apache.log4j.spi.LoggerRepository hierarchy,
                          Logger defaultLogger,
                          Logger logger)
Creates a new DefaultLog4JManager with an existing Hierarchy using specified logger name as root logger.


Log4JLoggerManager

public Log4JLoggerManager(java.lang.String prefix,
                          org.apache.log4j.spi.LoggerRepository hierarchy,
                          java.lang.String switchToCategory,
                          Logger defaultLogger,
                          Logger logger)
Creates a new DefaultLog4JManager.

Parameters:
prefix - to prepend to every category name on getLoggerForCategory()
hierarchy - a Log4J LoggerRepository to run with
switchToCategory - if this parameter is not null after start() LogKitLoggerManager will start to log its own debug and error messages to a logger obtained via this.getLoggerForCategory( switchToCategory ). Note that prefix will be prepended to the value of switchToCategory also.
defaultLogger - the logger to override the default logger configured by Log4J; probably should be null to allow users set up whatever logger they like as the root logger via Log4J configuration
logger - the logger to log our own initialization messages (currently we have none) and to log errors (currently this functionality is not used either)
Method Detail

doGetLoggerForCategory

protected Logger doGetLoggerForCategory(java.lang.String fullCategoryName)
Description copied from class: AbstractLoggerManager
Actually create a logger wrapping underlying logger backed implementation for a give category. Bypasses the caching. Derived LoggerManager implementations should provide an implementation of this method.

Specified by:
doGetLoggerForCategory in class AbstractLoggerManager


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.