This class is a helper to instanciate a logger factory. It provides a set of
init(...) method with various parameter:
- no parameter => automatic configuration with system property and default
values
- Properties => contains monolog configuration (loggers, handlers, levels
and optionaly the wrapper class name (automatic choice if not specified)).
- String => the class name of the wrapper class to instanciate
author: S.Chassande-Barrioz
getMonologFactory(String fileName) Initializes Monolog with a given monolog configuration file name
if the file is found, it delegates the intialization to init(Properties)
method.
getMonologFactory(Properties properties) Initializes monolog in with a Properties instance.
It searches from the properties the logger factory class name (
MONOLOG_CLASS_NAME property) and it delegates its configuration to
the loadMonologConfiguration(Properties, LoggerFactory) method.
Parameters: properties - can contains the MONOLOG_CLASS_NAME property and therest of the monolog configuration (loggers, handlers, levels).
instanciateMonologFactory(String className) Retrieves a MonologFactory instance.
First it tries to instanciate the given logger factory class name.
If it is not possible it tries to instanciate the logger factory of the
log4j system (if the classes are availlable).
If log4j or its wrapper are not reachable then it tries to instanciate
the wrapper of the log4jME logging system.
If log4jME or its wrapper are not reachable then it tries to instanciate
the wrapper of the java.util.logging logging system.
Finally if any of these wrappers are reachable the basic logger factory
is used.
Parameters: className - is the class name of a LoggerFactory implementation.It can be a null value.
This method must be only used to debug the Monolog wrappers.
To active the log of monolog assign the "true" value to the system
property "monolog.debug".
Parameters: m - the message to log.
Initializes Monolog with a given monolog configuration file name
if the file is found, it delegates the intialization to init(Properties)
method. if the file is not found it delegates the logger factory
instanciation to the getLoggerFactory(String) method.
Parameters: fileName - is the file name of a properties reachable from thefile system or the classpath. the loggerFactory (never null)
Initializes monolog in with a Properties instance.
It searches from the properties the logger factory class name (
MONOLOG_CLASS_NAME property) and it delegates its configuration to
the loadMonologConfiguration(Properties, LoggerFactory) method.
Parameters: properties - can contains the MONOLOG_CLASS_NAME property and therest of the monolog configuration (loggers, handlers, levels). the loggerFactory (never null)
Initializes Monolog.
It searches in system properties a monolog configuration file
(MONOLOG_FILE_NAME system property) or use the default file name
(DEFAULT_MONOLOG_FILE system property).
the loggerFactory (never null)
Retrieves a MonologFactory instance.
First it tries to instanciate the given logger factory class name.
If it is not possible it tries to instanciate the logger factory of the
log4j system (if the classes are availlable).
If log4j or its wrapper are not reachable then it tries to instanciate
the wrapper of the log4jME logging system.
If log4jME or its wrapper are not reachable then it tries to instanciate
the wrapper of the java.util.logging logging system.
Finally if any of these wrappers are reachable the basic logger factory
is used.
Parameters: className - is the class name of a LoggerFactory implementation.It can be a null value. a LoggerFactory instance (never null).
loadMonologConfiguration
public static void loadMonologConfiguration(Properties properties)(Code)
Loads a monolog configuration into the loggerFactory.
Parameters: properties - contains the properties to load into the given loggerfactory.
Loads a monolog configuration into an existing MonologFactory.
Parameters: properties - contains the properties to load into the given loggerfactory. Parameters: mf - is the MonologFactory to configure.