org.apache.avalon.excalibur.logger
Class LogKitLoggerManager

java.lang.Object
  |
  +--org.apache.avalon.excalibur.logger.LogKitLoggerManager
All Implemented Interfaces:
Configurable, Contextualizable, LogEnabled, LoggerManager

public class LogKitLoggerManager
extends Object
implements LoggerManager, LogEnabled, Contextualizable, Configurable

LogKitLoggerManager implementation. It populates the LoggerManager from a configuration file.

Since:
4.0
Version:
CVS $Revision: 1.11 $ $Date: 2003/02/25 16:28:24 $
Author:
Giacomo Pati, Berin Loritsch, Peter Royal

Field Summary
 
Fields inherited from interface org.apache.avalon.excalibur.logger.LoggerManager
ROLE
 
Constructor Summary
LogKitLoggerManager()
          Creates a new DefaultLogKitManager.
LogKitLoggerManager(Hierarchy hierarchy)
          Creates a new DefaultLogKitManager with an existing Hierarchy.
LogKitLoggerManager(String prefix)
          Creates a new DefaultLogKitManager using specified logger name as root logger.
LogKitLoggerManager(String prefix, Hierarchy hierarchy)
          Creates a new DefaultLogKitManager with an existing Hierarchy using specified logger name as root logger.
LogKitLoggerManager(String prefix, Hierarchy hierarchy, Logger defaultLogger)
          Creates a new DefaultLogKitManager with an existing Hierarchy using specified logger name as root logger.
LogKitLoggerManager(String prefix, Hierarchy hierarchy, Logger defaultLogger, Logger logger)
          Creates a new DefaultLogKitManager with an existing Hierarchy using specified logger name as root logger.
 
Method Summary
 void configure(Configuration configuration)
          Reads a configuration object and creates the category mapping.
 void contextualize(Context context)
          Reads a context object that will be supplied to the log target factory manager.
 void enableLogging(Logger logger)
          Provide a logger.
 Logger getDefaultLogger()
          Return the default Logger.
 Logger getLoggerForCategory(String categoryName)
          Retrieves a Logger from a category name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogKitLoggerManager

public LogKitLoggerManager()
Creates a new DefaultLogKitManager. It will use a new Hierarchy.


LogKitLoggerManager

public LogKitLoggerManager(Hierarchy hierarchy)
Creates a new DefaultLogKitManager with an existing Hierarchy.


LogKitLoggerManager

public LogKitLoggerManager(String prefix)
Creates a new DefaultLogKitManager using specified logger name as root logger.


LogKitLoggerManager

public LogKitLoggerManager(String prefix,
                           Hierarchy hierarchy)
Creates a new DefaultLogKitManager with an existing Hierarchy using specified logger name as root logger.


LogKitLoggerManager

public LogKitLoggerManager(String prefix,
                           Hierarchy hierarchy,
                           Logger defaultLogger)
Creates a new DefaultLogKitManager with an existing Hierarchy using specified logger name as root logger.


LogKitLoggerManager

public LogKitLoggerManager(String prefix,
                           Hierarchy hierarchy,
                           Logger defaultLogger,
                           Logger logger)
Creates a new DefaultLogKitManager with an existing Hierarchy using specified logger name as root logger.

Method Detail

enableLogging

public void enableLogging(Logger logger)
Provide a logger.

Specified by:
enableLogging in interface LogEnabled
Parameters:
logger - the logger

getLoggerForCategory

public final Logger getLoggerForCategory(String categoryName)
Retrieves a Logger from a category name. Usually the category name refers to a configuration attribute name. If this LogKitManager does not have the match the default Logger will be returned and a warning is issued.

Specified by:
getLoggerForCategory in interface LoggerManager
Parameters:
categoryName - The category name of a configured Logger.
Returns:
the Logger.

getDefaultLogger

public final Logger getDefaultLogger()
Description copied from interface: LoggerManager
Return the default Logger. This is basically the same as getting the Logger for the "" category.

Specified by:
getDefaultLogger in interface LoggerManager

contextualize

public final void contextualize(Context context)
                         throws ContextException
Reads a context object that will be supplied to the log target factory manager.

Specified by:
contextualize in interface Contextualizable
Parameters:
context - The context object.
Throws:
ContextException - if the context is malformed

configure

public final void configure(Configuration configuration)
                     throws ConfigurationException
Reads a configuration object and creates the category mapping.

Specified by:
configure in interface Configurable
Parameters:
configuration - The configuration object.
Throws:
ConfigurationException - if the configuration is malformed


Copyright © 2000-2003 Apache Jakarta Project. All Rights Reserved.