org.apache.log
public class Logger extends Object
Field Summary | |
---|---|
static char | CATEGORY_SEPARATOR
Separator character use to separate different categories |
static Logger[] | EMPTY_SET |
boolean | m_additivity
True means LogEvents will be sent to parents LogTargets
aswell as the ones set for this Logger. |
String | m_category |
Logger[] | m_children |
ErrorHandler | m_errorHandler |
LoggerListener | m_loggerListener |
LogTarget[] | m_logTargets |
boolean | m_logTargetsForceSet |
Logger | m_parent |
Priority | m_priority |
boolean | m_priorityForceSet |
Constructor Summary | |
---|---|
Logger(ErrorHandler errorHandler, LoggerListener loggerListener, String category, LogTarget[] logTargets, Logger parent)
Protected constructor for use inside the logging toolkit.
|
Method Summary | |
---|---|
void | debug(String message, Throwable throwable)
Log a debug priority event.
|
void | debug(String message)
Log a debug priority event.
|
void | error(String message, Throwable throwable)
Log a error priority event.
|
void | error(String message)
Log a error priority event.
|
void | fatalError(String message, Throwable throwable)
Log a fatalError priority event.
|
void | fatalError(String message)
Log a fatalError priority event.
|
void | fireEvent(LogEvent event, LogTarget[] targets) |
Logger | getChildLogger(String subCategory)
Create a new child logger.
|
Logger[] | getChildren()
Get all the child Loggers of current logger.
|
void | info(String message, Throwable throwable)
Log a info priority event.
|
void | info(String message)
Log a info priority event.
|
boolean | isDebugEnabled()
Determine if messages of priority DEBUG will be logged.
|
boolean | isErrorEnabled()
Determine if messages of priority ERROR will be logged.
|
boolean | isFatalErrorEnabled()
Determine if messages of priority FATAL_ERROR will be logged.
|
boolean | isInfoEnabled()
Determine if messages of priority INFO will be logged.
|
boolean | isPriorityEnabled(Priority priority)
Determine if messages of priority o? |
boolean | isWarnEnabled()
Determine if messages of priority WARN will be logged.
|
void | log(Priority priority, String message, Throwable throwable)
Log a event at specific priority with a certain message and throwable.
|
void | log(Priority priority, String message)
Log a event at specific priority with a certain message.
|
void | output(Priority priority, String message, Throwable throwable)
Internal method to do actual outputting.
|
void | output(LogEvent event) |
void | resetChildLogTargets(boolean recursive)
Update logTargets of children if any. |
void | resetChildPriorities(boolean recursive)
Update priority of children if any. |
void | resetLogTargets(boolean recursive)
Update logTarget of this Logger.
|
void | resetPriority(boolean recursive)
Update priority of this Logger.
|
LogTarget[] | safeGetLogTargets()
Retrieve logtarget array contained in logger.
|
void | setAdditivity(boolean additivity)
Make this logger additive. |
void | setLogTargets(LogTarget[] logTargets)
Set the log targets for this logger.
|
void | setPriority(Priority priority)
Set the priority for this logger.
|
void | setupErrorHandlers()
Set ErrorHandlers of LogTargets if necessary. |
void | unsetLogTargets()
Unset the logtargets for this logger.
|
void | unsetLogTargets(boolean recursive)
Unset the logtargets for this logger and all child loggers if recursive is set.
|
void | unsetPriority()
Unset the priority of Logger.
|
void | unsetPriority(boolean recursive)
Unset the priority of Logger.
|
void | warn(String message, Throwable throwable)
Log a warn priority event.
|
void | warn(String message)
Log a warn priority event.
|
Parameters: errorHandler the ErrorHandler logger uses to log errors category the fully qualified name of category logTargets the LogTargets associated with logger parent the parent logger (used for inheriting from)
Parameters: message the message throwable the throwable
Parameters: message the message
Parameters: message the message throwable the throwable
Parameters: message the message
Parameters: message the message throwable the throwable
Parameters: message the message
Parameters: subCategory the subcategory of this logger
Returns: the new logger
Throws: IllegalArgumentException if subCategory has an empty element name
Returns: the child loggers
Parameters: message the message throwable the throwable
Parameters: message the message
Returns: true if DEBUG messages will be logged
Returns: true if ERROR messages will be logged
Returns: true if FATAL_ERROR messages will be logged
Returns: true if INFO messages will be logged
Parameters: priority the priority
Returns: true if messages will be logged
Returns: true if WARN messages will be logged
Parameters: priority the priority message the message throwable the throwable
Parameters: priority the priority message the message
Parameters: priority the priority message the message throwable the throwable
Returns: the array of LogTargets
Parameters: additivity true to make logger additive, false otherwise
Parameters: logTargets the Log Targets
Parameters: priority the priority
Parameters: recursive the recursion policy
Parameters: recursive true to unset priority of all child loggers
Parameters: message the message throwable the throwable
Parameters: message the message