|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectorg.objectweb.util.monolog.wrapper.printwriter.LoggerImpl
This class is a simple implementation of the Logger interface provided by the monolog specification.
| Field Summary | |
|---|---|
protected boolean |
additivity
|
protected java.util.Hashtable |
handlers
|
protected java.util.Map |
levels
|
protected java.lang.String |
name
|
static java.lang.String |
PRINT_WRITER
|
protected java.util.Vector |
topics
|
| Fields inherited from interface org.objectweb.util.monolog.api.Handler |
|---|
APPEND_MODE_ATTRIBUTE, BUFFER_ATTRIBUTE, CONSOLE_HANDLER_TYPE, FILE_HANDLER_TYPE, FILE_NUMBER_ATTRIBUTE, GENERIC_HANDLER_TYPE, JMX_HANDLER_TYPE, LEVEL_ATTRIBUTE, LOGGER_HANDLER_TYPE, MAX_SIZE_ATTRIBUTE, OUTPUT_ATTRIBUTE, PATTERN_ATTRIBUTE, ROLLING_FILE_HANDLER_TYPE |
| Fields inherited from interface org.objectweb.util.monolog.api.MonologFactory |
|---|
DEFAULT, LOG_CONFIGURATION_FILE, LOG_CONFIGURATION_FILE_USE_CLASSPATH, LOG_CONFIGURATION_TYPE, PROPERTY, XML |
| Constructor Summary | |
|---|---|
LoggerImpl()
This constructor permits to specify the printWriter linked to this logger |
|
LoggerImpl(java.io.PrintWriter _pw)
This constructor permits to specify the printWriter linked to this logger |
|
LoggerImpl(java.lang.String n,
java.io.PrintWriter _pw)
This constructor permits to specify the printWriter linked to this logger |
|
| Method Summary | |
|---|---|
void |
addHandler(Handler h)
A TopicalLogger manages a list of Handler instances. |
void |
addMonologFactoryListener(MonologFactoryListener mfl)
register a listener for the events of this MonologFactory |
void |
addTopic(java.lang.String topic)
This method allows adding a topic to a TopicalLogger. |
void |
configure(java.util.Properties prop)
This method permits to order to a monolog wrapper to configure the underlying log system. |
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. |
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. |
static java.lang.String |
format(java.lang.String msg,
int removeTopStack)
This method permits to format messages. |
boolean |
getAdditivity()
It retrieves the additivity flag for this logger instance. |
java.lang.Object |
getAttribute(java.lang.String name)
It retrieves the value of an attribute value of the handler. |
java.lang.String[] |
getAttributeNames()
It retrieves the attributes of the handler |
int |
getCurrentIntLevel()
Gets the CurrentIntLevel attribute of the LoggerImpl object |
Level |
getCurrentLevel()
Gets the CurrentLevel attribute of the LoggerImpl object |
Handler[] |
getHandler()
It returns the list of the handler associated to this logger. |
Handler |
getHandler(java.lang.String hn)
It returns the handler which the name is equals to the parameter |
Handler[] |
getHandlers()
It retrieves all handler managed by this factory. |
Level |
getLevel(int value)
This method is not synchronized because the configuration is rarely |
Level |
getLevel(java.lang.String name)
It retrieves a Level instance which the name is equals to the parameter. |
Level[] |
getLevels()
This method is not synchronized because the configuration is rarely |
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 |
getName()
It retrieves the name of the handler |
java.io.PrintWriter |
getPrintWriter()
|
java.lang.String |
getResourceBundleName()
Accessors to a resource bundle name associated to a LoggerFactory. |
java.lang.String[] |
getTopic()
This method allows getting a topic list of this TopicalLogger. |
java.util.Enumeration |
getTopics()
Gets the Topics attribute of the LoggerImpl object |
java.lang.String |
getType()
It retrieves the Handler type |
boolean |
isLoggable(int l)
Gets the Loggable attribute of the LoggerImpl object |
boolean |
isLoggable(Level l)
Gets the Loggable attribute of the LoggerImpl object |
boolean |
isOn()
Gets the On attribute of the LoggerImpl object |
void |
log(int level,
java.lang.Object o)
Log method |
void |
log(int level,
java.lang.Object o,
java.lang.Object location,
java.lang.Object method)
Log method |
void |
log(int level,
java.lang.Object o,
java.lang.Throwable t)
Log method |
void |
log(int level,
java.lang.Object o,
java.lang.Throwable t,
java.lang.Object location,
java.lang.Object method)
Log method |
void |
log(Level l,
java.lang.Object o)
Log method |
void |
log(Level l,
java.lang.Object o,
java.lang.Object location,
java.lang.Object method)
Log method |
void |
log(Level l,
java.lang.Object o,
java.lang.Throwable t)
Log method |
void |
log(Level l,
java.lang.Object o,
java.lang.Throwable t,
java.lang.Object location,
java.lang.Object method)
Log method |
void |
removeAllHandlers()
A TopicalLogger manages a list of Handler instances. |
void |
removeHandler(Handler h)
A TopicalLogger manages a list of Handler instances. |
Handler |
removeHandler(java.lang.String handlername)
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 |
removeMonologFactoryListener(MonologFactoryListener mfl)
forget a listener for the events of this MonologFactory |
void |
removeTopic(java.lang.String topic)
This method allows removing a topic to a TopicalLogger. |
void |
setAdditivity(boolean a)
It assigns the additivity flag for this logger instance. |
java.lang.Object |
setAttribute(java.lang.String name,
java.lang.Object value)
It assigns an attributte to the handler. |
void |
setIntLevel(int l)
Sets the IntLevel attribute of the LoggerImpl object |
void |
setLevel(Level l)
Sets the Level attribute of the LoggerImpl object |
void |
setName(java.lang.String n)
It assigns the name of the handler |
void |
setResourceBundleName(java.lang.String resourceBundleName)
Accessors to a resource bundle name associated to a LoggerFactory. |
java.lang.String |
toString()
The toString method is override to signal the logger imlementation fowards its messages to a printwriter |
void |
turnOff()
Turn off this logger |
void |
turnOn()
Turn on this logger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String PRINT_WRITER
protected java.lang.String name
protected java.util.Vector topics
protected java.util.Hashtable handlers
protected boolean additivity
protected java.util.Map levels
| Constructor Detail |
public LoggerImpl()
public LoggerImpl(java.io.PrintWriter _pw)
_pw - the printwriter
public LoggerImpl(java.lang.String n,
java.io.PrintWriter _pw)
_pw - the printwriter| Method Detail |
public java.io.PrintWriter getPrintWriter()
public void addMonologFactoryListener(MonologFactoryListener mfl)
MonologFactory
addMonologFactoryListener in interface MonologFactorypublic void removeMonologFactoryListener(MonologFactoryListener mfl)
MonologFactory
removeMonologFactoryListener in interface MonologFactory
public void configure(java.util.Properties prop)
throws java.lang.Exception
MonologFactory
configure in interface MonologFactoryprop - contains properties which describes the way to configure.
In particular three properties could be used:
java.lang.Exception
public Handler createHandler(java.lang.String hn,
java.lang.String handlertype)
HandlerFactory
createHandler in interface HandlerFactoryhandlertype - is the type of the parameter. The possible value are
defined in this interface by the XXX_HANDLER_TYPE constants.
public Handler removeHandler(java.lang.String handlername)
HandlerFactory
removeHandler in interface HandlerFactoryhandlername - is the name of the handler
public Handler[] getHandlers()
HandlerFactory
getHandlers in interface HandlerFactory
public Level defineLevel(java.lang.String name,
int value)
LevelFactory
defineLevel in interface LevelFactoryname - is the name of the new levelvalue - is the integer value of the new level
public Level defineLevel(java.lang.String name,
java.lang.String value)
LevelFactory
defineLevel in interface LevelFactoryname - is the name of the new levelvalue - is the string value of the new level
public Level getLevel(java.lang.String name)
LevelFactory
getLevel in interface LevelFactoryname - is the name of request Level
public Level getLevel(int value)
getLevel in interface LevelFactoryvalue - is the integer value of request Level
public Level[] getLevels()
getLevels in interface LevelFactorypublic void removeLevel(java.lang.String name)
LevelFactory
removeLevel in interface LevelFactorypublic Logger getLogger(java.lang.String key)
LoggerFactory
getLogger in interface LoggerFactory
public Logger getLogger(java.lang.String key,
java.lang.String resourceBundleName)
LoggerFactory
getLogger in interface LoggerFactorypublic java.lang.String getResourceBundleName()
LoggerFactory
getResourceBundleName in interface LoggerFactorypublic void setResourceBundleName(java.lang.String resourceBundleName)
LoggerFactory
setResourceBundleName in interface LoggerFactorypublic Logger[] getLoggers()
LoggerFactory
getLoggers in interface LoggerFactorypublic void setIntLevel(int l)
setIntLevel in interface Loggerl - The new IntLevel valuepublic void setLevel(Level l)
setLevel in interface Loggerl - The new Level valuepublic int getCurrentIntLevel()
getCurrentIntLevel in interface Loggerpublic Level getCurrentLevel()
getCurrentLevel in interface Loggerpublic boolean isLoggable(int l)
isLoggable in interface Loggerl - Description of Parameter
public boolean isLoggable(Level l)
isLoggable in interface Loggerl - Description of Parameter
public boolean isOn()
isOn in interface Loggerpublic java.util.Enumeration getTopics()
getTopics in interface TopicalLogger
public void log(int level,
java.lang.Object o)
log in interface Logger
public void log(Level l,
java.lang.Object o)
log in interface Logger
public void log(int level,
java.lang.Object o,
java.lang.Throwable t)
log in interface Logger
public void log(Level l,
java.lang.Object o,
java.lang.Throwable t)
log in interface Logger
public void log(int level,
java.lang.Object o,
java.lang.Object location,
java.lang.Object method)
log in interface Logger
public void log(Level l,
java.lang.Object o,
java.lang.Object location,
java.lang.Object method)
log in interface Logger
public void log(int level,
java.lang.Object o,
java.lang.Throwable t,
java.lang.Object location,
java.lang.Object method)
log in interface Logger
public void log(Level l,
java.lang.Object o,
java.lang.Throwable t,
java.lang.Object location,
java.lang.Object method)
log in interface Loggerpublic void turnOn()
turnOn in interface Loggerpublic void turnOff()
turnOff in interface Loggerpublic java.lang.String toString()
public void addHandler(Handler h)
throws java.lang.Exception
TopicalLogger
addHandler in interface TopicalLoggerjava.lang.Exception
public void addTopic(java.lang.String topic)
throws java.lang.Exception
TopicalLogger
addTopic in interface TopicalLoggerjava.lang.Exception
public void removeHandler(Handler h)
throws java.lang.Exception
TopicalLogger
removeHandler in interface TopicalLoggerjava.lang.Exception
public void removeAllHandlers()
throws java.lang.Exception
TopicalLogger
removeAllHandlers in interface TopicalLoggerjava.lang.Exception
public void removeTopic(java.lang.String topic)
throws java.lang.Exception
TopicalLogger
removeTopic in interface TopicalLoggerjava.lang.Exceptionpublic void setAdditivity(boolean a)
TopicalLogger
setAdditivity in interface TopicalLoggerpublic boolean getAdditivity()
TopicalLogger
getAdditivity in interface TopicalLoggerpublic Handler[] getHandler()
TopicalLogger
getHandler in interface TopicalLoggerpublic Handler getHandler(java.lang.String hn)
TopicalLogger
getHandler in interface TopicalLoggerpublic java.lang.String[] getTopic()
TopicalLogger
getTopic in interface TopicalLoggerpublic java.lang.String getName()
Handler
getName in interface Handlerpublic void setName(java.lang.String n)
Handler
setName in interface Handlerpublic java.lang.String getType()
Handler
getType in interface Handlerpublic java.lang.String[] getAttributeNames()
Handler
getAttributeNames in interface Handlerpublic java.lang.Object getAttribute(java.lang.String name)
Handler
getAttribute in interface Handlername - is an attribute name
public java.lang.Object setAttribute(java.lang.String name,
java.lang.Object value)
Handler
setAttribute in interface Handlername - is the attribute namevalue - is the attribute value
public static java.lang.String format(java.lang.String msg,
int removeTopStack)
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||