Class LogKitAdapter

  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.avalon.excalibur.logger.logkit.LogKitAdapter
All Implemented Interfaces:
LogEnabled, LoggerManager

public class LogKitAdapter
extends AbstractLogEnabled
implements LoggerManager

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

CVS $Revision: 1.5 $ $Date: 2004/03/10 13:54:51 $
Avalon Development Team

Field Summary
protected  Hierarchy m_hierarchy
          The hierarchy that really produces loggers.
Fields inherited from interface org.apache.avalon.excalibur.logger.LoggerManager
Constructor Summary
LogKitAdapter(Hierarchy hierarchy)
          Initialized LogKitAdapter to operate of a certain LogKit 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


protected final Hierarchy m_hierarchy
The hierarchy that really produces loggers.

Constructor Detail


public LogKitAdapter(Hierarchy hierarchy)
Initialized LogKitAdapter to operate of a certain LogKit Hierarchy.

Method Detail


public Logger getLoggerForCategory(java.lang.String categoryName)
Return the Logger for the specified category.

In LogKit getRootLogger() and getLoggerFor("") unless the logger for category "" has been explicitly configured return identically configured but different loggers.

Our LogKitConfHelper configures getRootLogger(), not getLoggerFor(""). We think this is a reasonable behavior and expect that LogKit Hierarchies configured by other means then LogKitConfHelper are configured in the same way.

This justifies our decision to return getRootLogger() when given "" category name.

Specified by:
getLoggerForCategory in interface LoggerManager


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.