org.apache.avalon.excalibur.logger
Class DefaultLogKitManager

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.avalon.excalibur.logger.DefaultLogKitManager
All Implemented Interfaces:
LogKitManager, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.logger.Loggable

Deprecated. we should use the new LogKitLoggerManager interface that directly supports the new framework Logger interface.

public class DefaultLogKitManager
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements LogKitManager, org.apache.avalon.framework.logger.Loggable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.configuration.Configurable

Default LogManager implementation. It populates the LogManager from a configuration file.

Since:
4.0
Version:
CVS $Revision: 1.12 $ $Date: 2004/03/10 13:54:49 $
Author:
Avalon Development Team

Field Summary
private  org.apache.avalon.framework.context.Context m_context
          Deprecated. The context object
private  org.apache.log.Hierarchy m_hierarchy
          Deprecated. The hierarchy private to LogKitManager
private  java.util.Map m_loggers
          Deprecated. Map for name to logger mapping
private  java.lang.String m_prefix
          Deprecated. The root logger to configure
 
Constructor Summary
DefaultLogKitManager()
          Deprecated. Creates a new DefaultLogKitManager.
DefaultLogKitManager(org.apache.log.Hierarchy hierarchy)
          Deprecated. Creates a new DefaultLogKitManager with an existing Hierarchy.
DefaultLogKitManager(java.lang.String prefix)
          Deprecated. Creates a new DefaultLogKitManager using specified logger name as root logger.
DefaultLogKitManager(java.lang.String prefix, org.apache.log.Hierarchy hierarchy)
          Deprecated. 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)
          Deprecated. Reads a configuration object and creates the category mapping.
 void contextualize(org.apache.avalon.framework.context.Context context)
          Deprecated. Reads a context object.
 org.apache.log.Hierarchy getHierarchy()
          Deprecated. Retrieve Hierarchy for Loggers configured by the system.
 org.apache.log.Logger getLogger(java.lang.String categoryName)
          Deprecated. Retrieves a Logger from a category name.
 void setLogger(org.apache.log.Logger logger)
          Deprecated.  
private  void setupLoggers(LogTargetManager targetManager, java.lang.String parentCategory, org.apache.avalon.framework.configuration.Configuration[] categories)
          Deprecated. Setup Loggers
private  LogTargetFactoryManager setupTargetFactoryManager(org.apache.avalon.framework.configuration.Configuration configuration)
          Deprecated. Setup a LogTargetFactoryManager
private  LogTargetManager setupTargetManager(org.apache.avalon.framework.configuration.Configuration configuration, LogTargetFactoryManager targetFactoryManager)
          Deprecated. Setup a LogTargetManager
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_loggers

private final java.util.Map m_loggers
Deprecated. 
Map for name to logger mapping


m_context

private org.apache.avalon.framework.context.Context m_context
Deprecated. 
The context object


m_hierarchy

private org.apache.log.Hierarchy m_hierarchy
Deprecated. 
The hierarchy private to LogKitManager


m_prefix

private java.lang.String m_prefix
Deprecated. 
The root logger to configure

Constructor Detail

DefaultLogKitManager

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


DefaultLogKitManager

public DefaultLogKitManager(org.apache.log.Hierarchy hierarchy)
Deprecated. 
Creates a new DefaultLogKitManager with an existing Hierarchy.


DefaultLogKitManager

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


DefaultLogKitManager

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

Method Detail

setLogger

public void setLogger(org.apache.log.Logger logger)
Deprecated. 
Specified by:
setLogger in interface org.apache.avalon.framework.logger.Loggable

getLogger

public final org.apache.log.Logger getLogger(java.lang.String categoryName)
Deprecated. 
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:
getLogger in interface LogKitManager
Parameters:
categoryName - The category name of a configured Logger.
Returns:
the Logger.

getHierarchy

public org.apache.log.Hierarchy getHierarchy()
Deprecated. 
Retrieve Hierarchy for Loggers configured by the system.

Specified by:
getHierarchy in interface LogKitManager
Returns:
the Hierarchy

contextualize

public final void contextualize(org.apache.avalon.framework.context.Context context)
                         throws org.apache.avalon.framework.context.ContextException
Deprecated. 
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
Deprecated. 
Reads a configuration object and creates the category mapping. If the <categories/> element has an attribute named debug, it will try to load a configuration file specified by that attribute. The contents of that configuration file will be the same as the <categories/> element.

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

setupTargetFactoryManager

private final LogTargetFactoryManager setupTargetFactoryManager(org.apache.avalon.framework.configuration.Configuration configuration)
                                                         throws org.apache.avalon.framework.configuration.ConfigurationException
Deprecated. 
Setup a LogTargetFactoryManager

Parameters:
configuration - The configuration object.
Throws:
org.apache.avalon.framework.configuration.ConfigurationException - if the configuration is malformed

setupTargetManager

private final LogTargetManager setupTargetManager(org.apache.avalon.framework.configuration.Configuration configuration,
                                                  LogTargetFactoryManager targetFactoryManager)
                                           throws org.apache.avalon.framework.configuration.ConfigurationException
Deprecated. 
Setup a LogTargetManager

Parameters:
configuration - The configuration object.
Throws:
org.apache.avalon.framework.configuration.ConfigurationException - if the configuration is malformed

setupLoggers

private final void setupLoggers(LogTargetManager targetManager,
                                java.lang.String parentCategory,
                                org.apache.avalon.framework.configuration.Configuration[] categories)
                         throws org.apache.avalon.framework.configuration.ConfigurationException
Deprecated. 
Setup Loggers

Parameters:
categories - The array object of configurations for categories.
Throws:
org.apache.avalon.framework.configuration.ConfigurationException - if the configuration is malformed