public class Log4JLogger extends Object implements Log, Serializable
Log
that maps directly to a Log4J
Logger.
Initial configuration of the corresponding Logger instances should be done in the usual manner, as outlined in the Log4J documentation.
More or less "stolen" from Apache's commons-logging.
Constructor and Description |
---|
Log4JLogger() |
Log4JLogger(Class<?> clazz)
Base constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
debug(Object message)
Log a message to the Log4j Logger with
DEBUG priority. |
void |
debug(Object message,
Throwable t)
Log an error to the Log4j Logger with
DEBUG priority. |
void |
error(Object message)
Log a message to the Log4j Logger with
ERROR priority. |
void |
error(Object message,
Throwable t)
Log an error to the Log4j Logger with
ERROR priority. |
void |
fatal(Object message)
Log a message to the Log4j Logger with
FATAL priority. |
void |
fatal(Object message,
Throwable t)
Log an error to the Log4j Logger with
FATAL priority. |
org.apache.log4j.Logger |
getLogger()
Return the native Logger instance we are using.
|
void |
info(Object message)
Log a message to the Log4j Logger with
INFO priority. |
void |
info(Object message,
Throwable t)
Log an error to the Log4j Logger with
INFO priority. |
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)
Log a message to the Log4j Logger with
TRACE priority. |
void |
trace(Object message,
Throwable t)
Log an error to the Log4j Logger with
TRACE priority. |
void |
warn(Object message)
Log a message to the Log4j Logger with
WARN priority. |
void |
warn(Object message,
Throwable t)
Log an error to the Log4j Logger with
WARN priority. |
public Log4JLogger()
public Log4JLogger(Class<?> clazz)
public void trace(Object message)
TRACE
priority.
Currently logs to DEBUG
level in Log4J.public void trace(Object message, Throwable t)
TRACE
priority.
Currently logs to DEBUG
level in Log4J.public void debug(Object message)
DEBUG
priority.public void debug(Object message, Throwable t)
DEBUG
priority.public void info(Object message)
INFO
priority.public void info(Object message, Throwable t)
INFO
priority.public void warn(Object message)
WARN
priority.public void warn(Object message, Throwable t)
WARN
priority.public void error(Object message)
ERROR
priority.public void error(Object message, Throwable t)
ERROR
priority.public void fatal(Object message)
FATAL
priority.public void fatal(Object message, Throwable t)
FATAL
priority.public final org.apache.log4j.Logger getLogger()
public boolean isDebugEnabled()
DEBUG
priority.isDebugEnabled
in interface Log
public boolean isErrorEnabled()
ERROR
priority.public boolean isFatalEnabled()
FATAL
priority.public boolean isInfoEnabled()
INFO
priority.public boolean isTraceEnabled()
TRACE
priority. For Log4J, this returns the value of
isDebugEnabled()
public boolean isWarnEnabled()
WARN
priority.Copyright © 2004–2020. All rights reserved.