Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
org.apache.log4j.Logger
org.objectweb.util.monolog.wrapper.log4j.MonologCategory
Nested Class Summary | |
class | |
class |
Field Summary | |
protected static int | |
protected static int | |
protected ArrayList |
|
protected org.apache.log4j.Logger |
|
protected byte | |
protected boolean | |
protected MonologCategory.OwPriority | |
protected HashMap |
|
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 , LEVEL_ATTRIBUTE , LOGGER_HANDLER_TYPE , MAX_SIZE_ATTRIBUTE , OUTPUT_ATTRIBUTE , PATTERN_ATTRIBUTE , ROLLING_FILE_HANDLER_TYPE |
Constructor Summary | |
| |
|
Method Summary | |
void |
|
void |
|
void |
|
boolean |
|
static String |
|
Object |
|
String[] | |
org.apache.log4j.Level |
|
int |
|
Level |
|
Handler[] |
|
Handler |
|
String[] |
|
Enumeration |
|
String |
|
boolean |
|
boolean |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void | |
void | |
void | |
void | |
void |
|
void |
|
void |
|
Object |
|
void |
|
void | |
void |
|
void |
|
void |
|
protected static final int DISABLE_OFF
- Field Value:
- -1
protected static final int DISABLE_ON
protected ArrayList appenders
This field references all appenders associated to the current Logger
protected org.apache.log4j.Logger categ
This field references the inner Category if the delegation was choosen.
protected byte depth
protected boolean enable
protected HashMap topicToparents
This field references all parent of this Logger. key = topic of the current logger value = its parent either the topic. A parent can be a MonologCategory or a Category.
public MonologCategory(String _initialName)
This constructor initializes the instance in inheritance mode. It initializes the instanceFQN, and struture of parents.
public MonologCategory(org.apache.log4j.Logger c)
This constructor initializes the instance in delegation mode.
- Parameters:
c
- is the inner category. All calls will be foward to this instance
public void addHandler(Handler h) throws Exception
Add a handler in the Handler list of the topicalLogger
- Specified by:
- addHandler in interface TopicalLogger
public void addTopic(String topic) throws Exception
Add a topic to the topicalLogger
- Specified by:
- addTopic in interface TopicalLogger
public void callAppenders(LoggingEvent event)
In inheritance mode this method delegates the treatment to the other callAppendes methods. In delegation mode, the call is forwarded on the inner Category instance.
public boolean callAppenders(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. The true is return beacause the event must be transmitted
- Or if the current priority is define and the message priority is equals or greater then the current priority then all parent are call with the same value, and the logging event are transmitted to the appenders. The true is return beacause the event must be transmitted
- Else It is needed to check one of the parent is enable for the logging event. This is done by the recall of each parent. If one of the parent return true, then the event must be logged.
- Parameters:
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 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.
- Parameters:
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 String[] getAttributeNames()
- Specified by:
- getAttributeNames in interface Handler
public org.apache.log4j.Level getChainedLevel()
Starting from this category, search the category hierarchy for a non-null priority and return it. Otherwise, return the priority of the root category. The Category class is designed so that this method executes as quickly as possible.
public int getCurrentIntLevel()
Return the current Level of the logger
- Specified by:
- getCurrentIntLevel in interface Logger
public Level getCurrentLevel()
Returns the current level value under the Level format
- Specified by:
- getCurrentLevel in interface Logger
public Handler[] getHandler()
It returns the list of the handler associated to this logger.
- Specified by:
- getHandler in interface TopicalLogger
- Returns:
- an array of Handler or an empty array.
public Handler getHandler(String hn)
It returns the handler which the name is equals to the parameter
- Specified by:
- getHandler in interface TopicalLogger
- Returns:
- an Handler or a null value.
public String[] getTopic()
Returns the list of the different names of the topicalLogger
- Specified by:
- getTopic in interface TopicalLogger
public Enumeration getTopics()
Returns the list of the different names of the topicalLogger
- Specified by:
- getTopics in interface TopicalLogger
public boolean isLoggable(int level)
Check if the level parameter are not filtered by the logger
- Specified by:
- isLoggable in interface Logger
public boolean isLoggable(Level l)
Check if a message of the given level would actually be logged by this logger.
- Specified by:
- isLoggable in interface Logger
public void log(int level, Object o)
Log an object with a specific level. If the level parameter is loggable the object is handled.
public void log(int level, Object o, Object location, Object method)
Log an object and a trowable with a specific level. This method permits to specify an object instance and a method.
public void log(int level, Object o, Throwable t)
Log an object and a trowable with a specific level.
public void log(int level, Object o, Throwable t, Object location, Object method)
Log an object and a trowable with a specific level. This method permits to specify an object instance and a method.
public void log(Level l, Object o)
Log a message, with no arguments. If the logger is currently enabled for the given message level then the given message is treated
public void log(Level l, Object o, Object location, Object method)
Log a message, with a location and method arguments. The location parameter can be the object instance which logs the event, or a string representation of the object. The method argument can be a java.lang.reflect.Method or a string which represents the method name.
public void log(Level l, Object o, Throwable t)
Log a message, with a throwable arguments which can represent an error or a context..
public void log(Level l, Object o, Throwable t, Object location, Object method)
Log a message, with a location, method and throwable arguments. The location parameter can be the object instance which logs the event, or a string representation of the object.. The method argument can be a java.lang.reflect.Method or a string which represents the method name. The throwable parameter permits to log an Exception.
public void removeAllHandlers() throws Exception
A TopicalLogger manages a list of Handler instances. This method allows removing all handler.
- Specified by:
- removeAllHandlers in interface TopicalLogger
public void removeHandler(Handler h) throws Exception
Remove a handler from the Handler list of the topicalLogger
- Specified by:
- removeHandler in interface TopicalLogger
public void removeTopic(String topic) throws Exception
Remove a topic from the topicalLogger
- Specified by:
- removeTopic in interface TopicalLogger
public Object setAttribute(String name, Object value)
- Specified by:
- setAttribute in interface Handler
public void setIntLevel(int level)
Set the current level of the logger
- Specified by:
- setIntLevel in interface Logger