org.objectweb.util.monolog.wrapper.log4j
Class MonologLoggerFactory

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

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 static Logger rootLogger
          The root logger of the logger hierarchy
 
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
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 addLogInfo(Character pattern, LogInfo logInfoProvider)
          Add the extention
 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()
           
 LogInfo getLogInfo(Character pattern)
          Gets the provider of the extension
 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

LOG4J_CF_PROP

public static final String LOG4J_CF_PROP
See Also:
Constant Field Values

LOG4J_CF_VALUE

public static final String LOG4J_CF_VALUE
See Also:
Constant Field Values

rootLogger

protected static Logger rootLogger
The root logger of the logger hierarchy

Constructor Detail

MonologLoggerFactory

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

Method Detail

getWrapperName

public String getWrapperName()
Specified by:
getWrapperName in class AbstractFactory

getDefaultHandlerType2className

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

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
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()
Specified by:
getLoggers in interface LoggerFactory
Specified by:
getLoggers in class AbstractFactory

addLogInfo

public void addLogInfo(Character pattern,
                       LogInfo logInfoProvider)
Add the extention

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

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.