public class MonologLoggerFactory extends java.lang.Object implements MonologFactory
Modifier and Type | Field and Description |
---|---|
protected java.util.Hashtable |
handlers
This field references the handler instance by their names.
key = a String object which is an handler name. |
protected java.util.Hashtable |
intToNames
This field reference the level names by their integer value.
key = a java.lang.Integer which the value is the level value = a String or an ArrayList of String. |
static java.lang.String |
LOG4J_CF_PROP |
static java.lang.String |
LOG4J_CF_VALUE |
protected java.util.Hashtable |
nameToLevel
This field references the level instances by their names.
key = a level name value = the unique Level instance linked to the name. |
protected Logger |
rootLogger
The root logger of the logger hierarchy
|
DEFAULT, LOG_CONFIGURATION_FILE, LOG_CONFIGURATION_FILE_USE_CLASSPATH, LOG_CONFIGURATION_TYPE, PROPERTY, XML
Constructor and Description |
---|
MonologLoggerFactory() |
Modifier and Type | Method and Description |
---|---|
void |
configure(java.util.Properties prop)
This method permits to configure the factory.
|
Handler |
createHandler(java.lang.String hn,
java.lang.String handlertype)
It retrieves a new instance of an handler which the type is specified
by the parameter.
|
protected void |
defineDefaultLevels()
It initializes the default monolog level:
DEBUG: 10 000
INFO: 20 000
WARN: 30 000
ERROR: 40 000
FATAL: 50 000
|
Level |
defineLevel(java.lang.String name,
int value)
It defines a new Level with a name and an integer value.
|
Level |
defineLevel(java.lang.String name,
java.lang.String value)
It defines a new Level with a name and a string value.
|
Handler |
getHandler(java.lang.String hn)
It retrieves the handler which the name is specified by the parameter
|
Handler[] |
getHandlers()
It retrieves all handler managed by this factory.
|
Level |
getLevel(int value)
It retrieves a Level instance which the integer value is equals to the
parameter.
|
Level |
getLevel(java.lang.String name)
It retrieves a Level instance which the name is equals to the parameter.
|
Level[] |
getLevels()
It retrieves all Level instances defined in this manager.
|
Logger |
getLogger(java.lang.String key)
This method permits to fetch a Logger.
|
Logger |
getLogger(java.lang.String key,
java.lang.String rbn)
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.
|
Handler |
removeHandler(java.lang.String hn)
It removes the handler which the name is specified by the parameter
|
void |
removeLevel(java.lang.String name)
It removes a Level instance to this manager.
|
void |
setResourceBundleName(java.lang.String rbn)
Accessors to a resource bundle name associated to a LoggerFactory.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addMonologFactoryListener, removeMonologFactoryListener
public static final java.lang.String LOG4J_CF_PROP
public static final java.lang.String LOG4J_CF_VALUE
protected java.util.Hashtable nameToLevel
protected java.util.Hashtable intToNames
protected java.util.Hashtable handlers
protected Logger rootLogger
protected void defineDefaultLevels()
public void configure(java.util.Properties prop) throws java.lang.Exception
configure
in interface MonologFactory
prop
- contains properties which describes the way to configure.
In particular three properties could be used:
java.lang.Exception
public Logger[] getLoggers()
LoggerFactory
getLoggers
in interface LoggerFactory
public Logger getLogger(java.lang.String key)
LoggerFactory
getLogger
in interface LoggerFactory
public Logger getLogger(java.lang.String key, java.lang.String rbn)
LoggerFactory
getLogger
in interface LoggerFactory
public java.lang.String getResourceBundleName()
LoggerFactory
getResourceBundleName
in interface LoggerFactory
public void setResourceBundleName(java.lang.String rbn)
LoggerFactory
setResourceBundleName
in interface LoggerFactory
public Level defineLevel(java.lang.String name, int value)
LevelFactory
defineLevel
in interface LevelFactory
name
- is the name of the new levelvalue
- is the integer value of the new levelpublic Level defineLevel(java.lang.String name, java.lang.String value)
LevelFactory
defineLevel
in interface LevelFactory
name
- is the name of the new levelvalue
- is the string value of the new levelpublic Level getLevel(java.lang.String name)
LevelFactory
getLevel
in interface LevelFactory
name
- is the name of request Levelpublic Level getLevel(int value)
LevelFactory
getLevel
in interface LevelFactory
value
- is the integer value of request Levelpublic Level[] getLevels()
LevelFactory
getLevels
in interface LevelFactory
public void removeLevel(java.lang.String name)
LevelFactory
removeLevel
in interface LevelFactory
public Handler createHandler(java.lang.String hn, java.lang.String handlertype)
HandlerFactory
createHandler
in interface HandlerFactory
handlertype
- is the type of the parameter. The possible value are
defined in this interface by the XXX_HANDLER_TYPE constants.public Handler[] getHandlers()
HandlerFactory
getHandlers
in interface HandlerFactory
public Handler getHandler(java.lang.String hn)
HandlerFactory
getHandler
in interface HandlerFactory
hn
- is the name of the handlerpublic Handler removeHandler(java.lang.String hn)
HandlerFactory
removeHandler
in interface HandlerFactory
hn
- is the name of the handler