Class Overview
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.
Summary
Public Methods |
void
|
debug(Object message, Throwable t)
Logs a message with org.apache.log4j.Priority.DEBUG .
|
void
|
debug(Object message)
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, Throwable t)
Logs a message with org.apache.log4j.Priority.WARN .
|
void
|
warn(Object message)
Logs a message with org.apache.log4j.Priority.WARN .
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
From interface
org.apache.commons.logging.Log
abstract
void
|
debug(Object message, Throwable t)
Log an error with debug log level.
|
abstract
void
|
debug(Object message)
Log a message with debug log level.
|
abstract
void
|
error(Object message)
Log a message with error log level.
|
abstract
void
|
error(Object message, Throwable t)
Log an error with error log level.
|
abstract
void
|
fatal(Object message)
Log a message with fatal log level.
|
abstract
void
|
fatal(Object message, Throwable t)
Log an error with fatal log level.
|
abstract
void
|
info(Object message)
Log a message with info log level.
|
abstract
void
|
info(Object message, Throwable t)
Log an error with info log level.
|
abstract
boolean
|
isDebugEnabled()
Is debug logging currently enabled?
Call this method to prevent having to perform expensive operations
(for example, String concatenation)
when the log level is more than debug.
|
abstract
boolean
|
isErrorEnabled()
Is error logging currently enabled?
Call this method to prevent having to perform expensive operations
(for example, String concatenation)
when the log level is more than error.
|
abstract
boolean
|
isFatalEnabled()
Is fatal logging currently enabled?
Call this method to prevent having to perform expensive operations
(for example, String concatenation)
when the log level is more than fatal.
|
abstract
boolean
|
isInfoEnabled()
Is info logging currently enabled?
Call this method to prevent having to perform expensive operations
(for example, String concatenation)
when the log level is more than info.
|
abstract
boolean
|
isTraceEnabled()
Is trace logging currently enabled?
Call this method to prevent having to perform expensive operations
(for example, String concatenation)
when the log level is more than trace.
|
abstract
boolean
|
isWarnEnabled()
Is warn logging currently enabled?
Call this method to prevent having to perform expensive operations
(for example, String concatenation)
when the log level is more than warn.
|
abstract
void
|
trace(Object message)
Log a message with trace log level.
|
abstract
void
|
trace(Object message, Throwable t)
Log an error with trace log level.
|
abstract
void
|
warn(Object message, Throwable t)
Log an error with warn log level.
|
abstract
void
|
warn(Object message)
Log a message with warn log level.
|
|
Public Constructors
public
Log4JLogger
(String name)
public
Log4JLogger
(Logger logger)
For use with a log4j factory.
Public Methods
public
void
debug
(Object message, Throwable t)
Logs a message with org.apache.log4j.Priority.DEBUG
.
Parameters
message
| to log |
t
| log this cause |
public
void
debug
(Object message)
Logs a message with org.apache.log4j.Priority.DEBUG
.
public
void
error
(Object message)
Logs a message with org.apache.log4j.Priority.ERROR
.
public
void
error
(Object message, Throwable t)
Logs a message with org.apache.log4j.Priority.ERROR
.
Parameters
message
| to log |
t
| log this cause |
public
void
fatal
(Object message)
Logs a message with org.apache.log4j.Priority.FATAL
.
public
void
fatal
(Object message, Throwable t)
Logs a message with org.apache.log4j.Priority.FATAL
.
Parameters
message
| to log |
t
| log this cause |
public
Logger
getLogger
()
Return the native Logger instance we are using.
public
void
info
(Object message)
Logs a message with org.apache.log4j.Priority.INFO
.
public
void
info
(Object message, Throwable t)
Logs a message with org.apache.log4j.Priority.INFO
.
Parameters
message
| to log |
t
| log this cause |
public
boolean
isDebugEnabled
()
Check whether the Log4j Logger used is enabled for DEBUG
priority.
Returns
- true if debug is enabled in the underlying logger.
public
boolean
isErrorEnabled
()
Check whether the Log4j Logger used is enabled for ERROR
priority.
Returns
- true if error is enabled in the underlying logger.
public
boolean
isFatalEnabled
()
Check whether the Log4j Logger used is enabled for FATAL
priority.
Returns
- true if fatal is enabled in the underlying logger.
public
boolean
isInfoEnabled
()
Check whether the Log4j Logger used is enabled for INFO
priority.
Returns
- true if info is enabled in the underlying logger.
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.
Returns
- true if trace is enabled in the underlying logger.
public
boolean
isWarnEnabled
()
Check whether the Log4j Logger used is enabled for WARN
priority.
Returns
- true if warn is enabled in the underlying logger.
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.
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.
Parameters
message
| to log |
t
| log this cause |
public
void
warn
(Object message, Throwable t)
Logs a message with org.apache.log4j.Priority.WARN
.
Parameters
message
| to log |
t
| log this cause |
public
void
warn
(Object message)
Logs a message with org.apache.log4j.Priority.WARN
.