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

java.lang.Object
  extended by org.objectweb.util.monolog.wrapper.common.AbstractFactory
      extended by org.objectweb.util.monolog.wrapper.javaLog.LoggerFactory
All Implemented Interfaces:
HandlerFactory, LevelFactory, LoggerFactory, MonologFactory, Configurable

public class LoggerFactory
extends AbstractFactory

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

Author:
S.Chassande-Barrioz, Mohammed Boukada (Log extension)

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.
protected static LogManager manager
          the LogManager of java.util.logging
static 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
CLASSLOADER_ISOLATION, classLoaderIsoltion, debug, handlers, handlerType2className, handlerTypes, intToNames, monologFactoryListeners, nameToLevel, resourceBundleName, rootLoggerName, rootLoggerPrefix
 
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 addLogInfo(Character pattern, LogInfo logInfoProvider)
          Add an extension
 void configure(Properties prop)
          This method permits to configure the factory.
protected  String[][] getDefaultHandlerType2className()
           
 Logger getLogger(String key)
           
 Logger getLogger(String key, String rbn)
           
 Logger[] getLoggers()
          It retrieves a list of all loggers.
 LogInfo getLogInfo(Character pattern)
          Gets the provider of the extension
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()
           
 void removeLogInfo(char pattern)
          Remove an extension
 
Methods inherited from class org.objectweb.util.monolog.wrapper.common.AbstractFactory
addMonologFactoryListener, createHandler, debug, defineLevel, defineLevel, getHandler, getHandlers, getLevel, getLevel, getLevels, getResourceBundleName, getRootLoggerPrefix, getTopicPrefix, getTopicWithoutPrefix, initHandlerType2className, monoLoggerName, 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 LogManager manager
the LogManager of java.util.logging


rootLogger

protected static Logger rootLogger
the root logger


JAVALOG_CONFIGURATION

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

See Also:
Constant Field Values

DEFAULT

public static final 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 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 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 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 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 String getWrapperName()
Specified by:
getWrapperName in class AbstractFactory

getDefaultHandlerType2className

protected String[][] getDefaultHandlerType2className()
Specified by:
getDefaultHandlerType2className in class 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.


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
Specified by:
configure in class AbstractFactory
Throws:
Exception

getLogger

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

getLogger

public Logger getLogger(String key,
                        String rbn)

getLoggers

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

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

addLogInfo

public void addLogInfo(Character pattern,
                       LogInfo logInfoProvider)
                throws Exception
Add an extension

Parameters:
pattern - Character corresponding to the info to add
logInfoProvider - instance of info provider
Throws:
Exception

removeLogInfo

public void removeLogInfo(char pattern)
Remove an extension

Parameters:
pattern - log info pattern

getLogInfo

public LogInfo getLogInfo(Character pattern)
Gets the provider of the extension

Parameters:
pattern -
Returns:
LogInfo provider


Copyright © 2012 OW2 Consortium. All Rights Reserved.