org.apache.avalon.excalibur.logger
Class DefaultLoggerManager

java.lang.Object
  extended by org.apache.avalon.excalibur.logger.DefaultLoggerManager
All Implemented Interfaces:
LoggerManager, org.apache.avalon.framework.activity.Disposable, Configurable, Contextualizable, LogEnabled, Serviceable, org.apache.avalon.framework.thread.ThreadSafe

public final class DefaultLoggerManager
extends Object
implements LoggerManager, org.apache.avalon.framework.thread.ThreadSafe, LogEnabled, Contextualizable, Configurable, Serviceable, org.apache.avalon.framework.activity.Disposable

This logger manager is a wrapper around all other "real" logger managers. The idea is to have one single configuration file where you can define, which logger manager (Log4J, LogKit etc.) you want to use, so you don't have to hard-code this.

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

Field Summary
 
Fields inherited from interface org.apache.avalon.excalibur.logger.LoggerManager
ROLE
 
Constructor Summary
DefaultLoggerManager()
          Creates a new DefaultLoggerManager.
DefaultLoggerManager(String prefix)
          Creates a new DefaultLoggerManager.
 
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 logger manager.
 void dispose()
           
 void enableLogging(Logger logger)
          Provide a logger.
 Logger getDefaultLogger()
          Return the default Logger.
 Logger getLoggerForCategory(String categoryName)
          Return the Logger for the specified category.
 void service(ServiceManager manager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLoggerManager

public DefaultLoggerManager()
Creates a new DefaultLoggerManager. .


DefaultLoggerManager

public DefaultLoggerManager(String prefix)
Creates a new DefaultLoggerManager. .

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)
Return the Logger for the specified category.

Specified by:
getLoggerForCategory in interface LoggerManager

getDefaultLogger

public final Logger getDefaultLogger()
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 logger 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

service

public void service(ServiceManager manager)
             throws ServiceException
Specified by:
service in interface Serviceable
Throws:
ServiceException

dispose

public void dispose()
Specified by:
dispose in interface org.apache.avalon.framework.activity.Disposable


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