org.objectweb.util.monolog.api
Interface LoggerFactory

All Known Subinterfaces:
MonologFactory

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(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.
 java.lang.String getTopicPrefix()
          A Logger Factory can have a prefix helping for isolate applications.
 void setResourceBundleName(java.lang.String resourceBundleName)
          Accessors to a resource bundle name associated to a LoggerFactory.
 

Method Detail

getLogger

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

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

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


setResourceBundleName

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


getLoggers

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


getTopicPrefix

java.lang.String getTopicPrefix()
A Logger Factory can have a prefix helping for isolate applications. To assume the isolation, a prefix can be used for topic name.

Returns:
the prefix of the topic name.