public class Log4JLogger extends Object implements Log, Serializable
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:
Constructor and Description |
---|
Log4JLogger() |
Log4JLogger(org.apache.log4j.Logger logger)
For use with a log4j factory.
|
Log4JLogger(String name)
Base constructor.
|
Modifier and Type | Method and Description |
---|---|
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 . |
org.apache.log4j.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 . |
public Log4JLogger()
public Log4JLogger(String name)
public Log4JLogger(org.apache.log4j.Logger logger)
public void trace(Object message)
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 logLog.trace(Object)
public void trace(Object message, Throwable t)
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 causeLog.trace(Object, Throwable)
public void debug(Object message)
org.apache.log4j.Priority.DEBUG
.debug
in interface Log
message
- to logLog.debug(Object)
public void debug(Object message, Throwable t)
org.apache.log4j.Priority.DEBUG
.debug
in interface Log
message
- to logt
- log this causeLog.debug(Object, Throwable)
public void info(Object message)
org.apache.log4j.Priority.INFO
.info
in interface Log
message
- to logLog.info(Object)
public void info(Object message, Throwable t)
org.apache.log4j.Priority.INFO
.info
in interface Log
message
- to logt
- log this causeLog.info(Object, Throwable)
public void warn(Object message)
org.apache.log4j.Priority.WARN
.warn
in interface Log
message
- to logLog.warn(Object)
public void warn(Object message, Throwable t)
org.apache.log4j.Priority.WARN
.warn
in interface Log
message
- to logt
- log this causeLog.warn(Object, Throwable)
public void error(Object message)
org.apache.log4j.Priority.ERROR
.error
in interface Log
message
- to logLog.error(Object)
public void error(Object message, Throwable t)
org.apache.log4j.Priority.ERROR
.error
in interface Log
message
- to logt
- log this causeLog.error(Object, Throwable)
public void fatal(Object message)
org.apache.log4j.Priority.FATAL
.fatal
in interface Log
message
- to logLog.fatal(Object)
public void fatal(Object message, Throwable t)
org.apache.log4j.Priority.FATAL
.fatal
in interface Log
message
- to logt
- log this causeLog.fatal(Object, Throwable)
public org.apache.log4j.Logger getLogger()
public boolean isDebugEnabled()
DEBUG
priority.isDebugEnabled
in interface Log
public boolean isErrorEnabled()
ERROR
priority.isErrorEnabled
in interface Log
public boolean isFatalEnabled()
FATAL
priority.isFatalEnabled
in interface Log
public boolean isInfoEnabled()
INFO
priority.isInfoEnabled
in interface Log
public boolean isTraceEnabled()
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
public boolean isWarnEnabled()
WARN
priority.isWarnEnabled
in interface Log
Copyright © 2001–2014 The Apache Software Foundation. All rights reserved.