org.apache.avalon.excalibur.logger.log4j
Class Log4JAdapter

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.avalon.excalibur.logger.log4j.Log4JAdapter
All Implemented Interfaces:
LogEnabled, LoggerManager
Direct Known Subclasses:
Log4JConfAdapter

public class Log4JAdapter
extends AbstractLogEnabled
implements LoggerManager

This class sits on top of an existing Log4J Hierarchy and returns logger wrapping Log4J loggers. Attach PrefixDecorator and/or CachingDecorator if desired.

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

Field Summary
protected  org.apache.log4j.spi.LoggerRepository m_hierarchy
           
 
Fields inherited from interface org.apache.avalon.excalibur.logger.LoggerManager
ROLE
 
Constructor Summary
Log4JAdapter(org.apache.log4j.spi.LoggerRepository hierarchy)
           
 
Method Summary
 Logger getDefaultLogger()
          Return the default Logger.
 Logger getLoggerForCategory(java.lang.String categoryName)
          Return the Logger for the specified category.
 
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_hierarchy

protected final org.apache.log4j.spi.LoggerRepository m_hierarchy
Constructor Detail

Log4JAdapter

public Log4JAdapter(org.apache.log4j.spi.LoggerRepository hierarchy)
Method Detail

getLoggerForCategory

public Logger getLoggerForCategory(java.lang.String categoryName)
Return the Logger for the specified category. Log4J probably won't like the "" category name so we shall better return its getRootLogger() instead.

Specified by:
getLoggerForCategory in interface LoggerManager

getDefaultLogger

public Logger getDefaultLogger()
Return the default Logger. This is basically the same as getting the Logger for the "" category.

Specified by:
getDefaultLogger in interface LoggerManager


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