org.objectweb.util.monolog.wrapper.javaLog

Class LoggerFactory

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

public class LoggerFactory
extends AbstractFactory

is the LoggerFactory for the wrapper to java.util.logging

Author:
S.Chassande-Barrioz

Field Summary

static String
CLASS
This constant means that this java log system must be initialize with a xml file
static String
DEFAULT
This constant means that this java log system must be initialize with the default configuration
static String
JAVALOG_CONFIGURATION
This constant is used to initialize the factory with the configure method
static String
JAVALOG_CONFIGURATION_CLASS
This constant is the properties class name with wich the java log system must be initialized.
static String
JAVALOG_CONFIGURATION_FILE
This constant is the properties file name with wich the java log system must be initialized.
static String
PROPERTY
This constant means that this java log system must be initialize with a property file
protected static LogManager
manager
the LogManager of java.util.logging
protected static Logger
rootLogger
the root logger

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

LoggerFactory()

Method Summary

void
configure(Properties prop)
This method permits to configure the factory.
protected String[][]
getDefaultHandlerType2className()
Logger
getLogger(String key)
This method permits to fetch a Logger.
Logger
getLogger(String key, String rbn)
This method permits to fetch a Logger.
Logger[]
getLoggers()
It retrieves a list of all loggers.
protected Logger
getMonoLogger(String name, String resName)
This method allocates org.objectweb.util.monolog.wrapper.javaLog.Logger objects whic are also java.util.logging.Logger and org.objectweb.util.monolog.api.Logger.
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

CLASS

public static final String CLASS
This constant means that this java log system must be initialize with a xml file


DEFAULT

public static final String DEFAULT
This constant means that this java log system must be initialize with the default configuration


JAVALOG_CONFIGURATION

public static final String JAVALOG_CONFIGURATION
This constant is used to initialize the factory with the configure method


JAVALOG_CONFIGURATION_CLASS

public static final String JAVALOG_CONFIGURATION_CLASS
This constant is the properties class name with wich the java log system must be initialized.


JAVALOG_CONFIGURATION_FILE

public static final String JAVALOG_CONFIGURATION_FILE
This constant is the properties file name with wich the java log system must be initialized.


PROPERTY

public static final String PROPERTY
This constant means that this java log system must be initialize with a property file


manager

protected static LogManager manager
the LogManager of java.util.logging


rootLogger

protected static Logger rootLogger
the root logger

Constructor Details

LoggerFactory

public LoggerFactory()

Method Details

configure

public void configure(Properties prop)
            throws Exception
This method permits to configure the factory. The properties parameter must contains the JAVALOG_CONFIGURATION property. Its value can be DEFAULT, PROPERTY or XML. In the PROPERTY case of the properties parameter must also contain the JAVALOG_CONFIGURATION_FILE property which the value is the configuration file name. In the CLASS case of the properties parameter must also contain the JAVALOG_CONFIGURATION_CLASS property which the value is the configuration class name which will initialized the java log system..
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)
This method permits to fetch a Logger. If the Logger described by the parameters does not exist, then the LoggerFactory must return a new instance of Logger. The key parameter is a description of the expected Logger. In simple cases, the key is the initial topic of the Logger.
Specified by:
getLogger in interface LoggerFactory
Overrides:
getLogger in interface AbstractFactory


getLogger

public Logger getLogger(String key,
                        String rbn)
This method permits to fetch a Logger. If the Logger described by the parameters does not exist, then the LoggerFactory must return a new instance of Logger. The key parameter is a description of the expected Logger. In simple cases, the key is the initial topic of the Logger. The resourceBundleName parameter allows specifying the name of a resource bundle in order to internationalise the logging.
Specified by:
getLogger in interface LoggerFactory


getLoggers

public Logger[] getLoggers()
It retrieves a list of all loggers.
Specified by:
getLoggers in interface LoggerFactory
Overrides:
getLoggers in interface AbstractFactory


getMonoLogger

protected Logger getMonoLogger(String name,
                               String resName)
This method allocates org.objectweb.util.monolog.wrapper.javaLog.Logger objects whic are also java.util.logging.Logger and org.objectweb.util.monolog.api.Logger.


getWrapperName

public String getWrapperName()
Overrides:
getWrapperName in interface AbstractFactory