public class AvalonLogger extends Object implements Log
There are two ways in which this class can be used:
AvalonLogger(Logger)). In this case, it acts
as a simple thin wrapping implementation over the logger. This is
particularly useful when using a property setter.
setDefaultLogger(org.apache.avalon.framework.logger.Logger) class property can be called which
sets the ancestral Avalon logger for this class. Any AvalonLogger
instances created through the LogFactory mechanisms will output
to child loggers of this Logger.
Note: AvalonLogger does not implement Serializable
because the constructors available for it make this impossible to achieve in all
circumstances; there is no way to "reconnect" to an underlying Logger object on
deserialization if one was just passed in to the constructor of the original
object. This class was marked Serializable in the 1.0.4 release of
commons-logging, but this never actually worked (a NullPointerException would
be thrown as soon as the deserialized object was used), so removing this marker
is not considered to be an incompatible change.
| Constructor and Description |
|---|
AvalonLogger(org.apache.avalon.framework.logger.Logger logger)
Constructs an
AvalonLogger that outputs to the given
Logger instance. |
AvalonLogger(String name)
Constructs an
AvalonLogger that will log to a child
of the Logger set by calling setDefaultLogger(org.apache.avalon.framework.logger.Logger). |
| Modifier and Type | Method and Description |
|---|---|
void |
debug(Object message)
Logs a message with
org.apache.avalon.framework.logger.Logger.debug. |
void |
debug(Object message,
Throwable t)
Logs a message with
org.apache.avalon.framework.logger.Logger.debug. |
void |
error(Object message)
Logs a message with
org.apache.avalon.framework.logger.Logger.error. |
void |
error(Object message,
Throwable t)
Logs a message with
org.apache.avalon.framework.logger.Logger.error. |
void |
fatal(Object message)
Logs a message with
org.apache.avalon.framework.logger.Logger.fatalError. |
void |
fatal(Object message,
Throwable t)
Logs a message with
org.apache.avalon.framework.logger.Logger.fatalError. |
org.apache.avalon.framework.logger.Logger |
getLogger()
Gets the Avalon logger implementation used to perform logging.
|
void |
info(Object message)
Logs a message with
org.apache.avalon.framework.logger.Logger.info. |
void |
info(Object message,
Throwable t)
Logs a message with
org.apache.avalon.framework.logger.Logger.info. |
boolean |
isDebugEnabled()
Is logging to
org.apache.avalon.framework.logger.Logger.debug enabled? |
boolean |
isErrorEnabled()
Is logging to
org.apache.avalon.framework.logger.Logger.error enabled? |
boolean |
isFatalEnabled()
Is logging to
org.apache.avalon.framework.logger.Logger.fatalError enabled? |
boolean |
isInfoEnabled()
Is logging to
org.apache.avalon.framework.logger.Logger.info enabled? |
boolean |
isTraceEnabled()
Is logging to
org.apache.avalon.framework.logger.Logger.debug enabled? |
boolean |
isWarnEnabled()
Is logging to
org.apache.avalon.framework.logger.Logger.warn enabled? |
static void |
setDefaultLogger(org.apache.avalon.framework.logger.Logger logger)
Sets the ancestral Avalon logger from which the delegating loggers will descend.
|
void |
trace(Object message)
Logs a message with
org.apache.avalon.framework.logger.Logger.debug. |
void |
trace(Object message,
Throwable t)
Logs a message with
org.apache.avalon.framework.logger.Logger.debug. |
void |
warn(Object message)
Logs a message with
org.apache.avalon.framework.logger.Logger.warn. |
void |
warn(Object message,
Throwable t)
Logs a message with
org.apache.avalon.framework.logger.Logger.warn. |
public AvalonLogger(org.apache.avalon.framework.logger.Logger logger)
AvalonLogger that outputs to the given
Logger instance.logger - the Avalon logger implementation to delegate topublic AvalonLogger(String name)
AvalonLogger that will log to a child
of the Logger set by calling setDefaultLogger(org.apache.avalon.framework.logger.Logger).name - the name of the avalon logger implementation to delegate topublic org.apache.avalon.framework.logger.Logger getLogger()
public static void setDefaultLogger(org.apache.avalon.framework.logger.Logger logger)
logger - the default avalon logger,
in case there is no logger instance supplied in constructorpublic void debug(Object message, Throwable t)
org.apache.avalon.framework.logger.Logger.debug.debug in interface Logmessage - to logt - log this causeLog.debug(Object, Throwable)public void debug(Object message)
org.apache.avalon.framework.logger.Logger.debug.debug in interface Logmessage - to log.Log.debug(Object)public void error(Object message, Throwable t)
org.apache.avalon.framework.logger.Logger.error.error in interface Logmessage - to logt - log this causeLog.error(Object, Throwable)public void error(Object message)
org.apache.avalon.framework.logger.Logger.error.error in interface Logmessage - to logLog.error(Object)public void fatal(Object message, Throwable t)
org.apache.avalon.framework.logger.Logger.fatalError.fatal in interface Logmessage - to log.t - log this cause.Log.fatal(Object, Throwable)public void fatal(Object message)
org.apache.avalon.framework.logger.Logger.fatalError.fatal in interface Logmessage - to logLog.fatal(Object)public void info(Object message, Throwable t)
org.apache.avalon.framework.logger.Logger.info.info in interface Logmessage - to logt - log this causeLog.info(Object, Throwable)public void info(Object message)
org.apache.avalon.framework.logger.Logger.info.info in interface Logmessage - to logLog.info(Object)public boolean isDebugEnabled()
org.apache.avalon.framework.logger.Logger.debug enabled?isDebugEnabled in interface LogLog.isDebugEnabled()public boolean isErrorEnabled()
org.apache.avalon.framework.logger.Logger.error enabled?isErrorEnabled in interface LogLog.isErrorEnabled()public boolean isFatalEnabled()
org.apache.avalon.framework.logger.Logger.fatalError enabled?isFatalEnabled in interface LogLog.isFatalEnabled()public boolean isInfoEnabled()
org.apache.avalon.framework.logger.Logger.info enabled?isInfoEnabled in interface LogLog.isInfoEnabled()public boolean isTraceEnabled()
org.apache.avalon.framework.logger.Logger.debug enabled?isTraceEnabled in interface LogLog.isTraceEnabled()public boolean isWarnEnabled()
org.apache.avalon.framework.logger.Logger.warn enabled?isWarnEnabled in interface LogLog.isWarnEnabled()public void trace(Object message, Throwable t)
org.apache.avalon.framework.logger.Logger.debug.trace in interface Logmessage - to log.t - log this cause.Log.trace(Object, Throwable)public void trace(Object message)
org.apache.avalon.framework.logger.Logger.debug.trace in interface Logmessage - to logLog.trace(Object)public void warn(Object message, Throwable t)
org.apache.avalon.framework.logger.Logger.warn.warn in interface Logmessage - to logt - log this causeLog.warn(Object, Throwable)public void warn(Object message)
org.apache.avalon.framework.logger.Logger.warn.warn in interface Logmessage - to logLog.warn(Object)Copyright © 2001–2014 The Apache Software Foundation. All rights reserved.