org.objectweb.util.monolog.wrapper.javaLog
Class LoggerFactory

java.lang.Object
  extended byorg.objectweb.util.monolog.wrapper.common.AbstractFactory
      extended byorg.objectweb.util.monolog.wrapper.javaLog.LoggerFactory
All 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 java.lang.String CLASS
          This constant means that this java log system must be initialize with a xml file
static java.lang.String DEFAULT
          This constant means that this java log system must be initialize with the default configuration
static java.lang.String JAVALOG_CONFIGURATION
          This constant is used to initialize the factory with the configure method
static java.lang.String JAVALOG_CONFIGURATION_CLASS
          This constant is the properties class name with wich the java log system must be initialized.
static java.lang.String JAVALOG_CONFIGURATION_FILE
          This constant is the properties file name with wich the java log system must be initialized.
protected static java.util.logging.LogManager manager
          the LogManager of java.util.logging
static java.lang.String PROPERTY
          This constant means that this java log system must be initialize with a property file
protected static Logger rootLogger
          the root logger
 
Fields inherited from class org.objectweb.util.monolog.wrapper.common.AbstractFactory
debug, handlers, handlerType2className, handlerTypes, intToNames, monologFactoryListeners, nameToLevel, resourceBundleName
 
Fields inherited from interface org.objectweb.util.monolog.api.MonologFactory
LOG_CONFIGURATION_FILE, LOG_CONFIGURATION_FILE_USE_CLASSPATH, LOG_CONFIGURATION_TYPE, XML
 
Constructor Summary
LoggerFactory()
           
 
Method Summary
 void configure(java.util.Properties prop)
          This method permits to configure the factory.
protected  java.lang.String[][] getDefaultHandlerType2className()
           
 Logger getLogger(java.lang.String key)
          This method permits to fetch a Logger.
 Logger getLogger(java.lang.String key, java.lang.String rbn)
          This method permits to fetch a Logger.
 Logger[] getLoggers()
          It retrieves a list of all loggers.
protected  Logger getMonoLogger(java.lang.String name, java.lang.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.
 java.lang.String getWrapperName()
           
 
Methods inherited from class org.objectweb.util.monolog.wrapper.common.AbstractFactory
addMonologFactoryListener, createHandler, debug, defineLevel, defineLevel, getHandler, getHandlers, getLevel, getLevel, getLevels, getResourceBundleName, initHandlerType2className, removeHandler, removeLevel, removeMonologFactoryListener, setResourceBundleName, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

manager

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


rootLogger

protected static Logger rootLogger
the root logger


JAVALOG_CONFIGURATION

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

See Also:
Constant Field Values

DEFAULT

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

See Also:
Constant Field Values

PROPERTY

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

See Also:
Constant Field Values

CLASS

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

See Also:
Constant Field Values

JAVALOG_CONFIGURATION_FILE

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

See Also:
Constant Field Values

JAVALOG_CONFIGURATION_CLASS

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

See Also:
Constant Field Values
Constructor Detail

LoggerFactory

public LoggerFactory()
Method Detail

getWrapperName

public java.lang.String getWrapperName()
Specified by:
getWrapperName in class AbstractFactory

getDefaultHandlerType2className

protected java.lang.String[][] getDefaultHandlerType2className()
Specified by:
getDefaultHandlerType2className in class AbstractFactory

getMonoLogger

protected Logger getMonoLogger(java.lang.String name,
                               java.lang.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.


configure

public void configure(java.util.Properties prop)
               throws java.lang.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
Specified by:
configure in class AbstractFactory
Throws:
java.lang.Exception

getLogger

public Logger getLogger(java.lang.String key)
Description copied from interface: LoggerFactory
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
Specified by:
getLogger in class AbstractFactory

getLogger

public Logger getLogger(java.lang.String key,
                        java.lang.String rbn)
Description copied from interface: LoggerFactory
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.


getLoggers

public Logger[] getLoggers()
It retrieves a list of all loggers.

Specified by:
getLoggers in interface LoggerFactory
Specified by:
getLoggers in class AbstractFactory