org.apache.commons.logging.impl
Class Log4JLogger
java.lang.Object
org.apache.commons.logging.impl.Log4JLogger
- Log, Serializable
public class Log4JLogger
extends java.lang.Object
implements Log, Serializable
Implementation of
Log
that maps directly to a
Logger for log4J version 1.2.
Initial configuration of the corresponding Logger instances should be done
in the usual manner, as outlined in the Log4J documentation.
The reason this logger is distinct from the 1.3 logger is that in version 1.2
of Log4J:
- class Logger takes Priority parameters not Level parameters.
- class Level extends Priority
Log4J1.3 is expected to change Level so it no longer extends Priority, which is
a non-binary-compatible change. The class generated by compiling this code against
log4j 1.2 will therefore not run against log4j 1.3.
$Id: Log4JLogger.java 479747 2006-11-27 20:15:01Z dennisl $private static String | FQCN - The fully qualified name of the Log4JLogger class.
|
private Logger | logger - Log to this logger
|
private String | name - Logger name
|
private static Priority | traceLevel
|
void | debug(Object message) - Logs a message with
org.apache.log4j.Priority.DEBUG .
|
void | debug(Object message, Throwable t) - Logs a message with
org.apache.log4j.Priority.DEBUG .
|
void | error(Object message) - Logs a message with
org.apache.log4j.Priority.ERROR .
|
void | error(Object message, Throwable t) - Logs a message with
org.apache.log4j.Priority.ERROR .
|
void | fatal(Object message) - Logs a message with
org.apache.log4j.Priority.FATAL .
|
void | fatal(Object message, Throwable t) - Logs a message with
org.apache.log4j.Priority.FATAL .
|
Logger | getLogger() - Return the native Logger instance we are using.
|
void | info(Object message) - Logs a message with
org.apache.log4j.Priority.INFO .
|
void | info(Object message, Throwable t) - Logs a message with
org.apache.log4j.Priority.INFO .
|
boolean | isDebugEnabled() - Check whether the Log4j Logger used is enabled for
DEBUG priority.
|
boolean | isErrorEnabled() - Check whether the Log4j Logger used is enabled for
ERROR priority.
|
boolean | isFatalEnabled() - Check whether the Log4j Logger used is enabled for
FATAL priority.
|
boolean | isInfoEnabled() - Check whether the Log4j Logger used is enabled for
INFO priority.
|
boolean | isTraceEnabled() - Check whether the Log4j Logger used is enabled for
TRACE priority.
|
boolean | isWarnEnabled() - Check whether the Log4j Logger used is enabled for
WARN priority.
|
void | trace(Object message) - Logs a message with
org.apache.log4j.Priority.TRACE .
|
void | trace(Object message, Throwable t) - Logs a message with
org.apache.log4j.Priority.TRACE .
|
void | warn(Object message) - Logs a message with
org.apache.log4j.Priority.WARN .
|
void | warn(Object message, Throwable t) - Logs a message with
org.apache.log4j.Priority.WARN .
|
FQCN
private static final String FQCN
The fully qualified name of the Log4JLogger class.
logger
private Logger logger
Log to this logger
name
private String name
Logger name
traceLevel
private static Priority traceLevel
Log4JLogger
public Log4JLogger()
Log4JLogger
public Log4JLogger(Logger logger)
For use with a log4j factory.
Log4JLogger
public Log4JLogger(String name)
Base constructor.
debug
public void debug(Object message)
Logs a message with org.apache.log4j.Priority.DEBUG
.
- debug in interface Log
debug
public void debug(Object message,
Throwable t)
Logs a message with org.apache.log4j.Priority.DEBUG
.
- debug in interface Log
message
- to logt
- log this cause
error
public void error(Object message)
Logs a message with org.apache.log4j.Priority.ERROR
.
- error in interface Log
error
public void error(Object message,
Throwable t)
Logs a message with org.apache.log4j.Priority.ERROR
.
- error in interface Log
message
- to logt
- log this cause
fatal
public void fatal(Object message)
Logs a message with org.apache.log4j.Priority.FATAL
.
- fatal in interface Log
fatal
public void fatal(Object message,
Throwable t)
Logs a message with org.apache.log4j.Priority.FATAL
.
- fatal in interface Log
message
- to logt
- log this cause
getLogger
public Logger getLogger()
Return the native Logger instance we are using.
info
public void info(Object message)
Logs a message with org.apache.log4j.Priority.INFO
.
- info in interface Log
info
public void info(Object message,
Throwable t)
Logs a message with org.apache.log4j.Priority.INFO
.
- info in interface Log
message
- to logt
- log this cause
isDebugEnabled
public boolean isDebugEnabled()
Check whether the Log4j Logger used is enabled for DEBUG
priority.
- isDebugEnabled in interface Log
isErrorEnabled
public boolean isErrorEnabled()
Check whether the Log4j Logger used is enabled for ERROR
priority.
- isErrorEnabled in interface Log
isFatalEnabled
public boolean isFatalEnabled()
Check whether the Log4j Logger used is enabled for FATAL
priority.
- isFatalEnabled in interface Log
isInfoEnabled
public boolean isInfoEnabled()
Check whether the Log4j Logger used is enabled for INFO
priority.
- isInfoEnabled in interface Log
isTraceEnabled
public boolean isTraceEnabled()
Check whether the Log4j Logger used is enabled for TRACE
priority.
When using a log4j version that does not support the TRACE level, this call
will report whether DEBUG
is enabled or not.
- isTraceEnabled in interface Log
isWarnEnabled
public boolean isWarnEnabled()
Check whether the Log4j Logger used is enabled for WARN
priority.
- isWarnEnabled in interface Log
trace
public void trace(Object message)
Logs a message with org.apache.log4j.Priority.TRACE
.
When using a log4j version that does not support the TRACE
level, the message will be logged at the DEBUG
level.
- trace in interface Log
trace
public void trace(Object message,
Throwable t)
Logs a message with org.apache.log4j.Priority.TRACE
.
When using a log4j version that does not support the TRACE
level, the message will be logged at the DEBUG
level.
- trace in interface Log
message
- to logt
- log this cause
warn
public void warn(Object message)
Logs a message with org.apache.log4j.Priority.WARN
.
- warn in interface Log
warn
public void warn(Object message,
Throwable t)
Logs a message with org.apache.log4j.Priority.WARN
.
- warn in interface Log
message
- to logt
- log this cause
Copyright 2002-2004 The Apache Software Foundation.