org.objectweb.util.monolog.api

Interface LoggerFactory

Known Subinterfaces:
Configurable, MonologFactory
Known Implementing Classes:
AbstractFactory, BasicFactory, LoggerFactory, LoggerImpl, MonologLoggerFactory, 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.

Author:
S.Chassande-Barrioz

Method Summary

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

Method Details

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.


getLogger

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


getLoggers

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


getResourceBundleName

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


setResourceBundleName

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