org.objectweb.util.monolog.wrapper.log4j

Class MonologLoggerFactory

Implemented Interfaces:
Configurable, HandlerFactory, LevelFactory, LoggerFactory, MonologFactory

public class MonologLoggerFactory
extends AbstractFactory

This class wraps the LoggerFactory, HandlerFactory, LevelFactory concepts into the log4j world. This implementation supports also the Configurable interface. Then it is possible to specify a log4j configuration file.

Author:
Sebastien Chassande-Barrioz

Field Summary

static String
LOG4J_CF_PROP
static String
LOG4J_CF_VALUE
protected Logger
rootLogger
The root logger of the logger hierarchy

Fields inherited from class org.objectweb.util.monolog.wrapper.common.AbstractFactory

debug, handlerType2className, handlerTypes, handlers, intToNames, nameToLevel, resourceBundleName

Fields inherited from interface org.objectweb.util.monolog.api.MonologFactory

DEFAULT, LOG_CONFIGURATION_FILE, LOG_CONFIGURATION_FILE_USE_CLASSPATH, LOG_CONFIGURATION_TYPE, PROPERTY, XML

Constructor Summary

MonologLoggerFactory()
It intializes the data struture, defines the default level and the root logger.

Method Summary

void
configure(Properties prop)
This method permits to configure the factory with tha specific configuration file: like a log4j.properties
protected String[][]
getDefaultHandlerType2className()
Logger
getLogger(String key)
Logger
getLogger(String key, String rbn)
Logger[]
getLoggers()
String
getWrapperName()

Methods inherited from class org.objectweb.util.monolog.wrapper.common.AbstractFactory

configure, createHandler, debug, defineLevel, defineLevel, getDefaultHandlerType2className, getHandler, getHandlers, getLevel, getLevel, getLevels, getLogger, getLoggers, getResourceBundleName, getWrapperName, initHandlerType2className, removeHandler, removeLevel, setResourceBundleName, warn

Field Details

LOG4J_CF_PROP

public static final String LOG4J_CF_PROP


LOG4J_CF_VALUE

public static final String LOG4J_CF_VALUE


rootLogger

protected Logger rootLogger
The root logger of the logger hierarchy

Constructor Details

MonologLoggerFactory

public MonologLoggerFactory()
It intializes the data struture, defines the default level and the root logger.

Method Details

configure

public void configure(Properties prop)
            throws Exception
This method permits to configure the factory with tha specific configuration file: like a log4j.properties
Specified by:
configure in interface MonologFactory
Overrides:
configure in interface AbstractFactory


getDefaultHandlerType2className

protected String[][] getDefaultHandlerType2className()
Overrides:
getDefaultHandlerType2className in interface AbstractFactory


getLogger

public Logger getLogger(String key)
Specified by:
getLogger in interface LoggerFactory
Overrides:
getLogger in interface AbstractFactory


getLogger

public Logger getLogger(String key,
                        String rbn)
Specified by:
getLogger in interface LoggerFactory


getLoggers

public Logger[] getLoggers()
Specified by:
getLoggers in interface LoggerFactory
Overrides:
getLoggers in interface AbstractFactory


getWrapperName

public String getWrapperName()
Overrides:
getWrapperName in interface AbstractFactory