org.apache.avalon.excalibur.logger
Class LogKitLoggerManager

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

public class LogKitLoggerManager
extends java.lang.Object
implements LoggerManager, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.configuration.Configurable

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

Since:
4.0
Version:
CVS $Revision: 1.1 $ $Date: 2002/01/17 20:44:59 $
Author:
Giacomo Pati, Berin Loritsch

Constructor Summary
LogKitLoggerManager()
          Creates a new DefaultLogKitManager.
LogKitLoggerManager(org.apache.log.Hierarchy hierarchy)
          Creates a new DefaultLogKitManager with an existing Hierarchy.
LogKitLoggerManager(java.lang.String prefix)
          Creates a new DefaultLogKitManager using specified logger name as root logger.
LogKitLoggerManager(java.lang.String prefix, org.apache.log.Hierarchy hierarchy)
          Creates a new DefaultLogKitManager with an existing Hierarchy using specified logger name as root logger.
LogKitLoggerManager(java.lang.String prefix, org.apache.log.Hierarchy hierarchy, org.apache.avalon.framework.logger.Logger defaultLogger)
          Creates a new DefaultLogKitManager with an existing Hierarchy using specified logger name as root logger.
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
          Reads a configuration object and creates the category mapping.
 void contextualize(org.apache.avalon.framework.context.Context context)
          Reads a context object.
 org.apache.avalon.framework.logger.Logger getDefaultLogger()
          Return the default Logger.
 org.apache.avalon.framework.logger.Logger getLoggerForCategory(java.lang.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(org.apache.log.Hierarchy hierarchy)
Creates a new DefaultLogKitManager with an existing Hierarchy.

LogKitLoggerManager

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

LogKitLoggerManager

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

LogKitLoggerManager

public LogKitLoggerManager(java.lang.String prefix,
                           org.apache.log.Hierarchy hierarchy,
                           org.apache.avalon.framework.logger.Logger defaultLogger)
Creates a new DefaultLogKitManager with an existing Hierarchy using specified logger name as root logger.
Method Detail

getLoggerForCategory

public final org.apache.avalon.framework.logger.Logger getLoggerForCategory(java.lang.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 org.apache.avalon.framework.logger.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(org.apache.avalon.framework.context.Context context)
                         throws org.apache.avalon.framework.context.ContextException
Reads a context object.
Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable
Parameters:
context - The context object.
Throws:
org.apache.avalon.framework.context.ContextException - if the context is malformed

configure

public final void configure(org.apache.avalon.framework.configuration.Configuration configuration)
                     throws org.apache.avalon.framework.configuration.ConfigurationException
Reads a configuration object and creates the category mapping.
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Parameters:
configuration - The configuration object.
Throws:
org.apache.avalon.framework.configuration.ConfigurationException - if the configuration is malformed


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.