org.apache.avalon.composition.logging.impl
Class DefaultLoggingManager

java.lang.Object
  extended byorg.apache.avalon.composition.logging.impl.DefaultLoggingManager
All Implemented Interfaces:
LoggingManager

public class DefaultLoggingManager
extends Object
implements LoggingManager

A LoggerManager interface declares operation supporting the management of a logging hierarchy.

Author:
Avalon Development Team

Field Summary
 
Fields inherited from interface org.apache.avalon.composition.logging.LoggingManager
DEFAULT_FORMAT, DEFAULT_PRIORITY, DEFAULT_TARGET, KEY
 
Constructor Summary
DefaultLoggingManager(File base, LoggingDescriptor descriptor)
          Application of a runtime context to the manager.
DefaultLoggingManager(File base, LoggingDescriptor descriptor, boolean debug)
          Application of a runtime context to the manager.
 
Method Summary
 void addCategories(CategoriesDirective descriptor)
          Add a set of category entries using the supplied categories descriptor.
 void addCategories(String root, CategoriesDirective directive)
          Add a set of category entries relative to the supplied base category path, using the supplied descriptor as the definition of subcategories.
 Logger getLoggerForCategory(CategoryDirective category)
          Configure Logging channel based on the description supplied in a category descriptor.
 Logger getLoggerForCategory(String category)
          Return the Logger for the specified category.
 Logger getLoggerForCategory(String name, String target, String priority)
          Create a logging channel configured with the supplied category path, priority and target.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLoggingManager

public DefaultLoggingManager(File base,
                             LoggingDescriptor descriptor)
                      throws Exception

Application of a runtime context to the manager. The context value will be passed directly to lifestyle handlers established by this service.

Parameters:
base - the directory for logging targets
descriptor - the logging system descriptor (may be null)

DefaultLoggingManager

public DefaultLoggingManager(File base,
                             LoggingDescriptor descriptor,
                             boolean debug)
                      throws Exception

Application of a runtime context to the manager. The context value will be passed directly to lifestyle handlers established by this service.

Parameters:
base - the directory for logging targets
descriptor - the logging system descriptor (may be null)
debug - a debug flag
Method Detail

addCategories

public void addCategories(CategoriesDirective descriptor)
Add a set of category entries using the supplied categories descriptor.

Specified by:
addCategories in interface LoggingManager
Parameters:
descriptor - a set of category descriptors to be added under the path

addCategories

public void addCategories(String root,
                          CategoriesDirective directive)
Add a set of category entries relative to the supplied base category path, using the supplied descriptor as the definition of subcategories.

Specified by:
addCategories in interface LoggingManager
Parameters:
root - the category base path
directive - a category directive to add

getLoggerForCategory

public Logger getLoggerForCategory(String name,
                                   String target,
                                   String priority)
                            throws Exception
Create a logging channel configured with the supplied category path, priority and target.

Specified by:
getLoggerForCategory in interface LoggingManager
Parameters:
name - logging category path
target - the logging target to assign the channel to
priority - the priority level to assign to the channel
Returns:
the logging channel
Throws:
Exception - if an error occurs

getLoggerForCategory

public Logger getLoggerForCategory(CategoryDirective category)
                            throws Exception
Configure Logging channel based on the description supplied in a category descriptor.

Specified by:
getLoggerForCategory in interface LoggingManager
Parameters:
category - defintion of the channel category, priority and target
Returns:
the logging channel
Throws:
Exception - if an error occurs

getLoggerForCategory

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

Specified by:
getLoggerForCategory in interface LoggingManager
Parameters:
category - the category path
Returns:
the logging channel


Copyright © Apache Software Foundation. All Rights Reserved.