org.objectledge.logging
Class LoggingConfigurator

java.lang.Object
  extended by org.objectledge.logging.LoggingConfigurator

public class LoggingConfigurator
extends Object

A component that initializes Log4J using a configuration file.

This component was introduced so that log system configufration were preformed in a way uniform with other parts of the system. The configuration file conforms to the Log4J DOMConfigurator schema. This package provides specialized Log4J objects, aware of ObjectLedge features that can be used in the configuration.

At this point the configurator retrieves a configuration InputSource from the configuration factory (it will get validated agains apropriate schema), parses it and passes on to Log4j DomConfigurator. In the future we may want to iterate over the configuration ourselves and instantiate the needed objects (appenders etc. The Pico Way). This will allow a number of neat things, including Appenders wrinting to Ledge FileSystem. Until then paths in the conifguration files need to be either absolute in the machine's FS, or relative to the container's working directory.

Functionality anticipated in the future

Related documentation

Dependencies

Version:
$Id: LoggingConfigurator.java,v 1.9 2006/03/13 18:22:02 zwierzem Exp $
Author:
rafal@caltha.pl

Constructor Summary
LoggingConfigurator()
          Creates a new LoggingConfigurator instance.
LoggingConfigurator(ConfigurationFactory configurationFactory, FileSystem fileSystem)
          Creates a new LoggingConfigurator.
 
Method Summary
 org.jcontainer.dna.Logger createLogger(String name)
          Creates a logger instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggingConfigurator

public LoggingConfigurator()
Creates a new LoggingConfigurator instance.

Instance created using this constructor does not alter configuration of Log4j in any way.


LoggingConfigurator

public LoggingConfigurator(ConfigurationFactory configurationFactory,
                           FileSystem fileSystem)
                    throws ParserConfigurationException,
                           IOException,
                           SAXException
Creates a new LoggingConfigurator.

Parameters:
configurationFactory - the configuration factory.
fileSystem - the file system component.
Throws:
ParserConfigurationException - if the JAXP system is not configured properly.
IOException - if the configuration cannot be loaded.
SAXException - if the configuration cannot be parsed.
Method Detail

createLogger

public org.jcontainer.dna.Logger createLogger(String name)
Creates a logger instance.

Parameters:
name - of the logger.
Returns:
a logger instance.


Copyright © 2003-2006 objectledge.org. All Rights Reserved.