org.objectweb.util.monolog.api
Interface LoggerFactory

All Known Subinterfaces:
Configurable, MonologFactory
All Known Implementing Classes:
AbstractFactory, BasicFactory, LoggerImpl, MonologComponent, MonologLoggerFactory

public interface LoggerFactory

The aims of this interface is to provide Logger instances, to allow instrumentation to be independent of the logging implementation and to allow the use of the same logging implementation for all the components of a given application.

This interface provides two methods to fetch Logger. If the Logger described by the parameters does not exist, then the LoggerFactory must return a new instance of Logger.

The LoggerFactory interface also provides accessors to a resource bundle name associated to a LoggerFactory. This interface allows defining a resource bundle name used by all Logger.


Method Summary
 Logger getLogger(java.lang.String key)
          This method permits to fetch a Logger.
 Logger getLogger(java.lang.String key, java.lang.String resourceBundleName)
          This method permits to fetch a Logger.
 Logger[] getLoggers()
          It retrieves a list of all loggers.
 java.lang.String getResourceBundleName()
          Accessors to a resource bundle name associated to a LoggerFactory.
 void setResourceBundleName(java.lang.String resourceBundleName)
          Accessors to a resource bundle name associated to a LoggerFactory.
 

Method Detail

getLogger

public Logger getLogger(java.lang.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.


getLogger

public Logger getLogger(java.lang.String key,
                        java.lang.String resourceBundleName)
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.


getResourceBundleName

public java.lang.String getResourceBundleName()
Accessors to a resource bundle name associated to a LoggerFactory.


setResourceBundleName

public void setResourceBundleName(java.lang.String resourceBundleName)
Accessors to a resource bundle name associated to a LoggerFactory.


getLoggers

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