|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.log4j.Category
org.apache.log4j.Logger
org.objectweb.util.monolog.wrapper.log4j.MonologCategory
public class MonologCategory
This class wraps the Logger concept into the log4j world. This class extends therefore the Logger class. This implementation supports
| Nested Class Summary | |
|---|---|
static class |
MonologCategory.BetaCF
|
static class |
MonologCategory.OwPriority
|
| Field Summary | |
|---|---|
protected ArrayList |
appenders
This field references all appenders associated to the current Logger |
protected org.apache.log4j.Logger |
categ
This field references the inner Logger if the delegation was choosen. |
protected byte |
depth
|
protected static int |
DISABLE_OFF
|
protected static int |
DISABLE_ON
|
protected boolean |
enable
|
protected MonologCategory.OwPriority |
interPriority
|
protected HashMap |
topicToparents
This field references all parent of this Logger. |
| Fields inherited from class org.apache.log4j.Category |
|---|
additive, level, name, parent, repository, resourceBundle |
| 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 |
| Constructor Summary | |
|---|---|
MonologCategory(org.apache.log4j.Logger c)
This constructor initializes the instance in delegation mode. |
|
MonologCategory(String _initialName)
This constructor initializes the instance in inheritance mode. |
|
| Method Summary | |
|---|---|
void |
addHandler(Handler h)
Add a handler in the Handler list of the topicalLogger |
void |
addTopic(String topic)
Add a topic to the topicalLogger |
void |
callAppenders(org.apache.log4j.spi.LoggingEvent event)
In inheritance mode this method delegates the treatment to the other callAppendes methods. |
boolean |
callAppenders(org.apache.log4j.spi.LoggingEvent event,
boolean called)
This method calls all the parent loggers and call its appender either the followin condition: if the called parameter is equals to true then all parent are call with the same value, and the logging event are transmitted to the appenders. |
static String |
format(String msg,
int removeTopStack)
It formats a message by adding the object and the method name where the call to monolog was done. |
Object |
getAttribute(String name)
|
String[] |
getAttributeNames()
|
org.apache.log4j.Level |
getChainedLevel()
Starting from this Logger, search the Logger hierarchy for a non-null priority and return it. |
int |
getCurrentIntLevel()
Return the current Level of the logger |
Level |
getCurrentLevel()
|
Handler[] |
getHandler()
|
Handler |
getHandler(String hn)
|
String[] |
getTopic()
Returns the list of the different names of the topicalLogger |
Enumeration |
getTopics()
Returns the list of the different names of the topicalLogger |
String |
getType()
|
boolean |
isLoggable(int l)
Check if the level parameter are not filtered by the logger |
boolean |
isLoggable(Level l)
|
boolean |
isOn()
Is the handler enabled |
void |
log(int l,
Object o)
Log an object with a specific level. |
void |
log(int l,
Object o,
Object location,
Object method)
Log an object and a trowable with a specific level. |
void |
log(int l,
Object o,
Throwable t)
Log an object and a trowable with a specific level. |
void |
log(int l,
Object o,
Throwable t,
Object location,
Object method)
Log an object and a trowable with a specific level. |
void |
log(Level l,
Object o)
|
void |
log(Level l,
Object o,
Object location,
Object method)
|
void |
log(Level l,
Object o,
Throwable t)
|
void |
log(Level l,
Object o,
Throwable t,
Object location,
Object method)
|
void |
removeAllHandlers()
|
void |
removeHandler(Handler h)
Remove a handler from the Handler list of the topicalLogger |
void |
removeTopic(String topic)
Remove a topic from the topicalLogger |
Object |
setAttribute(String name,
Object value)
|
void |
setIntLevel(int level)
Set the current level of the logger |
void |
setLevel(Level l)
|
void |
setName(String n)
|
void |
turnOff()
Disable the handler |
void |
turnOn()
Enable the handler |
| Methods inherited from class org.apache.log4j.Logger |
|---|
getLogger, getLogger, getLogger, getRootLogger, isTraceEnabled, trace, trace |
| Methods inherited from class org.apache.log4j.Category |
|---|
addAppender, assertLog, debug, debug, error, error, exists, fatal, fatal, forcedLog, getAdditivity, getAllAppenders, getAppender, getChainedPriority, getCurrentCategories, getDefaultHierarchy, getEffectiveLevel, getHierarchy, getInstance, getInstance, getLevel, getLoggerRepository, getName, getParent, getPriority, getResourceBundle, getResourceBundleString, getRoot, info, info, isAttached, isDebugEnabled, isEnabledFor, isInfoEnabled, l7dlog, l7dlog, log, log, log, removeAllAppenders, removeAppender, removeAppender, setAdditivity, setLevel, setPriority, setResourceBundle, shutdown, warn, warn |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.objectweb.util.monolog.api.TopicalLogger |
|---|
getAdditivity, setAdditivity |
| Methods inherited from interface org.objectweb.util.monolog.api.Handler |
|---|
getName |
| Field Detail |
|---|
protected boolean enable
protected static final int DISABLE_OFF
protected static final int DISABLE_ON
protected MonologCategory.OwPriority interPriority
protected byte depth
protected HashMap topicToparents
protected ArrayList appenders
protected org.apache.log4j.Logger categ
| Constructor Detail |
|---|
public MonologCategory(String _initialName)
public MonologCategory(org.apache.log4j.Logger c)
c - is the inner Logger. All calls will be foward to this instance| Method Detail |
|---|
public static String format(String msg,
int removeTopStack)
msg - is the original messageremoveTopStack - is the number of monolog method call. Indeed this method
fetch a stack trace. This method fetches one line in this stack. The
parameter is the line number in this stack.public org.apache.log4j.Level getChainedLevel()
The Logger class is designed so that this method executes as quickly as possible.
public void callAppenders(org.apache.log4j.spi.LoggingEvent event)
callAppenders in class org.apache.log4j.Category
public boolean callAppenders(org.apache.log4j.spi.LoggingEvent event,
boolean called)
event - is the logging eventcalled - is the boolean which permits to know if the current logger must
call or not its appender without check its priority.
return true is the logging event is enabled in the current logger or one
of its ancestors.public boolean isLoggable(int l)
isLoggable in interface Loggerpublic boolean isLoggable(Level l)
isLoggable in interface Loggerpublic boolean isOn()
isOn in interface Logger
public void log(int l,
Object o)
log in interface Logger
public void log(Level l,
Object o)
log in interface Logger
public void log(int l,
Object o,
Throwable t)
log in interface Logger
public void log(Level l,
Object o,
Throwable t)
log in interface Logger
public void log(int l,
Object o,
Object location,
Object method)
log in interface Logger
public void log(Level l,
Object o,
Object location,
Object method)
log in interface Logger
public void log(int l,
Object o,
Throwable t,
Object location,
Object method)
log in interface Logger
public void log(Level l,
Object o,
Throwable t,
Object location,
Object method)
log in interface Loggerpublic void turnOn()
turnOn in interface Loggerpublic void turnOff()
turnOff in interface Loggerpublic void setIntLevel(int level)
setIntLevel in interface Loggerpublic void setLevel(Level l)
setLevel in interface Loggerpublic int getCurrentIntLevel()
getCurrentIntLevel in interface Loggerpublic Level getCurrentLevel()
getCurrentLevel in interface Logger
public void addHandler(Handler h)
throws Exception
addHandler in interface TopicalLoggerException
public void addTopic(String topic)
throws Exception
addTopic in interface TopicalLoggerExceptionpublic Handler[] getHandler()
getHandler in interface TopicalLoggerpublic Handler getHandler(String hn)
getHandler in interface TopicalLogger
public void removeAllHandlers()
throws Exception
removeAllHandlers in interface TopicalLoggerExceptionpublic Enumeration getTopics()
getTopics in interface TopicalLoggerpublic String[] getTopic()
getTopic in interface TopicalLogger
public void removeHandler(Handler h)
throws Exception
removeHandler in interface TopicalLoggerException
public void removeTopic(String topic)
throws Exception
removeTopic in interface TopicalLoggerExceptionpublic void setName(String n)
setName in interface Handlerpublic String getType()
getType in interface Handlerpublic String[] getAttributeNames()
getAttributeNames in interface Handlerpublic Object getAttribute(String name)
getAttribute in interface Handler
public Object setAttribute(String name,
Object value)
setAttribute in interface Handler
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||