|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.logging.impl.AvalonLogger
Implementation of commons-logging Log interface that delegates all logging calls to the Avalon logging abstraction: the Logger interface.
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 ancesteral 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 Summary | |
AvalonLogger(org.apache.avalon.framework.logger.Logger logger)
Constructs an AvalonLogger that outputs to the given
Logger instance. |
|
AvalonLogger(java.lang.String name)
Constructs an AvalonLogger that will log to a child
of the Logger set by calling setDefaultLogger(org.apache.avalon.framework.logger.Logger) . |
Method Summary | |
void |
debug(java.lang.Object message)
Logs a message with org.apache.avalon.framework.logger.Logger.debug . |
void |
debug(java.lang.Object message,
java.lang.Throwable t)
Logs a message with org.apache.avalon.framework.logger.Logger.debug . |
void |
error(java.lang.Object message)
Logs a message with org.apache.avalon.framework.logger.Logger.error . |
void |
error(java.lang.Object message,
java.lang.Throwable t)
Logs a message with org.apache.avalon.framework.logger.Logger.error . |
void |
fatal(java.lang.Object message)
Logs a message with org.apache.avalon.framework.logger.Logger.fatalError . |
void |
fatal(java.lang.Object message,
java.lang.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(java.lang.Object message)
Logs a message with org.apache.avalon.framework.logger.Logger.info . |
void |
info(java.lang.Object message,
java.lang.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 ancesteral Avalon logger from which the delegating loggers will descend. |
void |
trace(java.lang.Object message)
Logs a message with org.apache.avalon.framework.logger.Logger.debug . |
void |
trace(java.lang.Object message,
java.lang.Throwable t)
Logs a message with org.apache.avalon.framework.logger.Logger.debug . |
void |
warn(java.lang.Object message)
Logs a message with org.apache.avalon.framework.logger.Logger.warn . |
void |
warn(java.lang.Object message,
java.lang.Throwable t)
Logs a message with org.apache.avalon.framework.logger.Logger.warn . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
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(java.lang.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 toMethod Detail |
public 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(java.lang.Object message, java.lang.Throwable t)
org.apache.avalon.framework.logger.Logger.debug
.
debug
in interface Log
message
- to logt
- log this causeLog.debug(Object, Throwable)
public void debug(java.lang.Object message)
org.apache.avalon.framework.logger.Logger.debug
.
debug
in interface Log
message
- to log.Log.debug(Object)
public void error(java.lang.Object message, java.lang.Throwable t)
org.apache.avalon.framework.logger.Logger.error
.
error
in interface Log
message
- to logt
- log this causeLog.error(Object, Throwable)
public void error(java.lang.Object message)
org.apache.avalon.framework.logger.Logger.error
.
error
in interface Log
message
- to logLog.error(Object)
public void fatal(java.lang.Object message, java.lang.Throwable t)
org.apache.avalon.framework.logger.Logger.fatalError
.
fatal
in interface Log
message
- to log.t
- log this cause.Log.fatal(Object, Throwable)
public void fatal(java.lang.Object message)
org.apache.avalon.framework.logger.Logger.fatalError
.
fatal
in interface Log
message
- to logLog.fatal(Object)
public void info(java.lang.Object message, java.lang.Throwable t)
org.apache.avalon.framework.logger.Logger.info
.
info
in interface Log
message
- to logt
- log this causeLog.info(Object, Throwable)
public void info(java.lang.Object message)
org.apache.avalon.framework.logger.Logger.info
.
info
in interface Log
message
- to logLog.info(Object)
public boolean isDebugEnabled()
org.apache.avalon.framework.logger.Logger.debug
enabled?
isDebugEnabled
in interface Log
Log.isDebugEnabled()
public boolean isErrorEnabled()
org.apache.avalon.framework.logger.Logger.error
enabled?
isErrorEnabled
in interface Log
Log.isErrorEnabled()
public boolean isFatalEnabled()
org.apache.avalon.framework.logger.Logger.fatalError
enabled?
isFatalEnabled
in interface Log
Log.isFatalEnabled()
public boolean isInfoEnabled()
org.apache.avalon.framework.logger.Logger.info
enabled?
isInfoEnabled
in interface Log
Log.isInfoEnabled()
public boolean isTraceEnabled()
org.apache.avalon.framework.logger.Logger.debug
enabled?
isTraceEnabled
in interface Log
Log.isTraceEnabled()
public boolean isWarnEnabled()
org.apache.avalon.framework.logger.Logger.warn
enabled?
isWarnEnabled
in interface Log
Log.isWarnEnabled()
public void trace(java.lang.Object message, java.lang.Throwable t)
org.apache.avalon.framework.logger.Logger.debug
.
trace
in interface Log
message
- to log.t
- log this cause.Log.trace(Object, Throwable)
public void trace(java.lang.Object message)
org.apache.avalon.framework.logger.Logger.debug
.
trace
in interface Log
message
- to logLog.trace(Object)
public void warn(java.lang.Object message, java.lang.Throwable t)
org.apache.avalon.framework.logger.Logger.warn
.
warn
in interface Log
message
- to logt
- log this causeLog.warn(Object, Throwable)
public void warn(java.lang.Object message)
org.apache.avalon.framework.logger.Logger.warn
.
warn
in interface Log
message
- to logLog.warn(Object)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |