org.apache.commons.logging.impl
Class AvalonLogger
java.lang.Object
org.apache.commons.logging.impl.AvalonLogger
- Log
public class AvalonLogger
extends java.lang.Object
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:
- the instance can be constructed with an Avalon logger
(by calling
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.
- the
setDefaultLogger(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.
$Revision: 399221 $ $Date: 2006-05-03 10:20:24 +0100 (Wed, 03 May 2006) $private static Logger | defaultLogger - Ancesteral avalon logger
|
private Logger | logger - Avalon logger used to perform log
|
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 .
|
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(Logger logger) - Sets the ancesteral 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 .
|
defaultLogger
private static Logger defaultLogger
Ancesteral avalon logger
logger
private Logger logger
Avalon logger used to perform log
AvalonLogger
public AvalonLogger(Logger logger)
Constructs an AvalonLogger
that outputs to the given
Logger
instance.
logger
- the avalon logger implementation to delegate to
AvalonLogger
public AvalonLogger(String name)
name
- the name of the avalon logger implementation to delegate to
debug
public void debug(Object message)
Logs a message with
org.apache.avalon.framework.logger.Logger.debug
.
- debug in interface Log
debug
public void debug(Object message,
Throwable t)
Logs a message with
org.apache.avalon.framework.logger.Logger.debug
.
- debug in interface Log
message
- to logt
- log this cause
error
public void error(Object message)
Logs a message with
org.apache.avalon.framework.logger.Logger.error
.
- error in interface Log
error
public void error(Object message,
Throwable t)
Logs a message with
org.apache.avalon.framework.logger.Logger.error
.
- error in interface Log
message
- to logt
- log this cause
fatal
public void fatal(Object message)
Logs a message with
org.apache.avalon.framework.logger.Logger.fatalError
.
- fatal in interface Log
fatal
public void fatal(Object message,
Throwable t)
Logs a message with
org.apache.avalon.framework.logger.Logger.fatalError
.
- fatal in interface Log
message
- to log.t
- log this cause.
getLogger
public Logger getLogger()
Gets the Avalon logger implementation used to perform logging.
- avalon logger implementation
info
public void info(Object message)
Logs a message with
org.apache.avalon.framework.logger.Logger.info
.
- info in interface Log
info
public void info(Object message,
Throwable t)
Logs a message with
org.apache.avalon.framework.logger.Logger.info
.
- info in interface Log
message
- to logt
- log this cause
isDebugEnabled
public boolean isDebugEnabled()
Is logging to
org.apache.avalon.framework.logger.Logger.debug
enabled?
- isDebugEnabled in interface Log
isErrorEnabled
public boolean isErrorEnabled()
Is logging to
org.apache.avalon.framework.logger.Logger.error
enabled?
- isErrorEnabled in interface Log
isFatalEnabled
public boolean isFatalEnabled()
Is logging to
org.apache.avalon.framework.logger.Logger.fatalError
enabled?
- isFatalEnabled in interface Log
isInfoEnabled
public boolean isInfoEnabled()
Is logging to
org.apache.avalon.framework.logger.Logger.info
enabled?
- isInfoEnabled in interface Log
isTraceEnabled
public boolean isTraceEnabled()
Is logging to
org.apache.avalon.framework.logger.Logger.debug
enabled?
- isTraceEnabled in interface Log
isWarnEnabled
public boolean isWarnEnabled()
Is logging to
org.apache.avalon.framework.logger.Logger.warn
enabled?
- isWarnEnabled in interface Log
setDefaultLogger
public static void setDefaultLogger(Logger logger)
Sets the ancesteral Avalon logger from which the delegating loggers
will descend.
logger
- the default avalon logger,
in case there is no logger instance supplied in constructor
trace
public void trace(Object message)
Logs a message with
org.apache.avalon.framework.logger.Logger.debug
.
- trace in interface Log
trace
public void trace(Object message,
Throwable t)
Logs a message with
org.apache.avalon.framework.logger.Logger.debug
.
- trace in interface Log
message
- to log.t
- log this cause.
warn
public void warn(Object message)
Logs a message with
org.apache.avalon.framework.logger.Logger.warn
.
- warn in interface Log
warn
public void warn(Object message,
Throwable t)
Logs a message with
org.apache.avalon.framework.logger.Logger.warn
.
- warn in interface Log
message
- to logt
- log this cause
Copyright 2002-2004 The Apache Software Foundation.