|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Logger
This is the central interface in the log4j package. Most logging operations, except configuration, are done through this interface.
The canonical way to obtain a Logger for a class is through LogManager.getLogger(). Typically, each class
gets its own Logger named after its fully qualified class name (the default Logger name when obtained through the
LogManager.getLogger() method). Thus, the simplest way to use this would be like so:
public class MyClass {
private static final Logger LOGGER = LogManager.getLogger();
// ...
}
For ease of filtering, searching, sorting, etc., it is generally a good idea to create Loggers for each class rather
than sharing Loggers. Instead, Markers should be used for shared, filterable identification.
For service provider implementations, it is recommended to extend the
AbstractLogger class rather than implementing this interface directly.
| Method Summary | ||
|---|---|---|
void |
catching(Level level,
Throwable t)
Logs an exception or error that has been caught to a specific logging level. |
|
void |
catching(Throwable t)
Logs an exception or error that has been caught. |
|
void |
debug(Marker marker,
Message msg)
Logs a message with the specific Marker at the DEBUG level. |
|
void |
debug(Marker marker,
Message msg,
Throwable t)
Logs a message with the specific Marker at the DEBUG level. |
|
void |
debug(Marker marker,
Object message)
Logs a message object with the DEBUG level. |
|
void |
debug(Marker marker,
Object message,
Throwable t)
Logs a message at the DEBUG level including the stack trace of the Throwable
t passed as parameter. |
|
void |
debug(Marker marker,
String message)
Logs a message object with the DEBUG level. |
|
void |
debug(Marker marker,
String message,
Object... params)
Logs a message with parameters at the DEBUG level. |
|
void |
debug(Marker marker,
String message,
Throwable t)
Logs a message at the DEBUG level including the stack trace of the Throwable
t passed as parameter. |
|
void |
debug(Message msg)
Logs a message with the specific Marker at the DEBUG level. |
|
void |
debug(Message msg,
Throwable t)
Logs a message with the specific Marker at the DEBUG level. |
|
void |
debug(Object message)
Logs a message object with the DEBUG level. |
|
void |
debug(Object message,
Throwable t)
Logs a message at the DEBUG level including the stack trace of the Throwable
t passed as parameter. |
|
void |
debug(String message)
Logs a message object with the DEBUG level. |
|
void |
debug(String message,
Object... params)
Logs a message with parameters at the DEBUG level. |
|
void |
debug(String message,
Throwable t)
Logs a message at the DEBUG level including the stack trace of the Throwable
t passed as parameter. |
|
void |
entry()
Logs entry to a method. |
|
void |
entry(Object... params)
Logs entry to a method along with its parameters. |
|
void |
error(Marker marker,
Message msg)
Logs a message with the specific Marker at the ERROR level. |
|
void |
error(Marker marker,
Message msg,
Throwable t)
Logs a message with the specific Marker at the ERROR level. |
|
void |
error(Marker marker,
Object message)
Logs a message object with the ERROR level. |
|
void |
error(Marker marker,
Object message,
Throwable t)
Logs a message at the ERROR level including the stack trace of the Throwable
t passed as parameter. |
|
void |
error(Marker marker,
String message)
Logs a message object with the ERROR level. |
|
void |
error(Marker marker,
String message,
Object... params)
Logs a message with parameters at the ERROR level. |
|
void |
error(Marker marker,
String message,
Throwable t)
Logs a message at the ERROR level including the stack trace of the Throwable
t passed as parameter. |
|
void |
error(Message msg)
Logs a message with the specific Marker at the ERROR level. |
|
void |
error(Message msg,
Throwable t)
Logs a message with the specific Marker at the ERROR level. |
|
void |
error(Object message)
Logs a message object with the ERROR level. |
|
void |
error(Object message,
Throwable t)
Logs a message at the ERROR level including the stack trace of the Throwable
t passed as parameter. |
|
void |
error(String message)
Logs a message object with the ERROR level. |
|
void |
error(String message,
Object... params)
Logs a message with parameters at the ERROR level. |
|
void |
error(String message,
Throwable t)
Logs a message at the ERROR level including the stack trace of the Throwable
t passed as parameter. |
|
void |
exit()
Logs exit from a method. |
|
|
exit(R result)
Logs exiting from a method with the result. |
|
void |
fatal(Marker marker,
Message msg)
Logs a message with the specific Marker at the FATAL level. |
|
void |
fatal(Marker marker,
Message msg,
Throwable t)
Logs a message with the specific Marker at the FATAL level. |
|
void |
fatal(Marker marker,
Object message)
Logs a message object with the FATAL level. |
|
void |
fatal(Marker marker,
Object message,
Throwable t)
Logs a message at the FATAL level including the stack trace of the Throwable
t passed as parameter. |
|
void |
fatal(Marker marker,
String message)
Logs a message object with the FATAL level. |
|
void |
fatal(Marker marker,
String message,
Object... params)
Logs a message with parameters at the FATAL level. |
|
void |
fatal(Marker marker,
String message,
Throwable t)
Logs a message at the FATAL level including the stack trace of the Throwable
t passed as parameter. |
|
void |
fatal(Message msg)
Logs a message with the specific Marker at the FATAL level. |
|
void |
fatal(Message msg,
Throwable t)
Logs a message with the specific Marker at the FATAL level. |
|
void |
fatal(Object message)
Logs a message object with the FATAL level. |
|
void |
fatal(Object message,
Throwable t)
Logs a message at the FATAL level including the stack trace of the Throwable
t passed as parameter. |
|
void |
fatal(String message)
Logs a message object with the FATAL level. |
|
void |
fatal(String message,
Object... params)
Logs a message with parameters at the FATAL level. |
|
void |
fatal(String message,
Throwable t)
Logs a message at the FATAL level including the stack trace of the Throwable
t passed as parameter. |
|
Level |
getLevel()
Gets the Level associated with the Logger. |
|
MessageFactory |
getMessageFactory()
Gets the message factory used to convert message Objects and Strings into actual log Messages. |
|
String |
getName()
Gets the logger name. |
|
void |
info(Marker marker,
Message msg)
Logs a message with the specific Marker at the INFO level. |
|
void |
info(Marker marker,
Message msg,
Throwable t)
Logs a message with the specific Marker at the INFO level. |
|
void |
info(Marker marker,
Object message)
Logs a message object with the INFO level. |
|
void |
info(Marker marker,
Object message,
Throwable t)
Logs a message at the INFO level including the stack trace of the Throwable
t passed as parameter. |
|
void |
info(Marker marker,
String message)
Logs a message object with the INFO level. |
|
void |
info(Marker marker,
String message,
Object... params)
Logs a message with parameters at the INFO level. |
|
void |
info(Marker marker,
String message,
Throwable t)
Logs a message at the INFO level including the stack trace of the Throwable
t passed as parameter. |
|
void |
info(Message msg)
Logs a message with the specific Marker at the INFO level. |
|
void |
info(Message msg,
Throwable t)
Logs a message with the specific Marker at the INFO level. |
|
void |
info(Object message)
Logs a message object with the INFO level. |
|
void |
info(Object message,
Throwable t)
Logs a message at the INFO level including the stack trace of the Throwable
t passed as parameter. |
|
void |
info(String message)
Logs a message object with the INFO level. |
|
void |
info(String message,
Object... params)
Logs a message with parameters at the INFO level. |
|
void |
info(String message,
Throwable t)
Logs a message at the INFO level including the stack trace of the Throwable
t passed as parameter. |
|
boolean |
isDebugEnabled()
Checks whether this Logger is enabled for the DEBUG Level. |
|
boolean |
isDebugEnabled(Marker marker)
Checks whether this Logger is enabled for the DEBUG Level. |
|
boolean |
isEnabled(Level level)
Checks whether this Logger is enabled for the the given Level. |
|
boolean |
isEnabled(Level level,
Marker marker)
Checks whether this logger is enabled at the specified level and an optional Marker. |
|
boolean |
isErrorEnabled()
Checks whether this Logger is enabled for the ERROR Level. |
|
boolean |
isErrorEnabled(Marker marker)
Checks whether this Logger is enabled for the ERROR Level. |
|
boolean |
isFatalEnabled()
Checks whether this Logger is enabled for the FATAL Level. |
|
boolean |
isFatalEnabled(Marker marker)
Checks whether this Logger is enabled for the FATAL Level. |
|
boolean |
isInfoEnabled()
Checks whether this Logger is enabled for the INFO Level. |
|
boolean |
isInfoEnabled(Marker marker)
Checks whether this Logger is enabled for the INFO Level. |
|
boolean |
isTraceEnabled()
Checks whether this Logger is enabled for the TRACE level. |
|
boolean |
isTraceEnabled(Marker marker)
Checks whether this Logger is enabled for the TRACE level. |
|
boolean |
isWarnEnabled()
Checks whether this Logger is enabled for the WARN Level. |
|
boolean |
isWarnEnabled(Marker marker)
Checks whether this Logger is enabled for the WARN Level. |
|
void |
log(Level level,
Marker marker,
Message msg)
Logs a message with the specific Marker at the given level. |
|
void |
log(Level level,
Marker marker,
Message msg,
Throwable t)
Logs a message with the specific Marker at the given level. |
|
void |
log(Level level,
Marker marker,
Object message)
Logs a message object with the given level. |
|
void |
log(Level level,
Marker marker,
Object message,
Throwable t)
Logs a message at the given level including the stack trace of the Throwable t passed as
parameter. |
|
void |
log(Level level,
Marker marker,
String message)
Logs a message object with the given level. |
|
void |
log(Level level,
Marker marker,
String message,
Object... params)
Logs a message with parameters at the given level. |
|
void |
log(Level level,
Marker marker,
String message,
Throwable t)
Logs a message at the given level including the stack trace of the Throwable t passed as
parameter. |
|
void |
log(Level level,
Message msg)
Logs a message with the specific Marker at the given level. |
|
void |
log(Level level,
Message msg,
Throwable t)
Logs a message with the specific Marker at the given level. |
|
void |
log(Level level,
Object message)
Logs a message object with the given level. |
|
void |
log(Level level,
Object message,
Throwable t)
Logs a message at the given level including the stack trace of the Throwable t passed as
parameter. |
|
void |
log(Level level,
String message)
Logs a message object with the given level. |
|
void |
log(Level level,
String message,
Object... params)
Logs a message with parameters at the given level. |
|
void |
log(Level level,
String message,
Throwable t)
Logs a message at the given level including the stack trace of the Throwable t passed as
parameter. |
|
void |
printf(Level level,
Marker marker,
String format,
Object... params)
Logs a formatted message using the specified format string and arguments. |
|
void |
printf(Level level,
String format,
Object... params)
Logs a formatted message using the specified format string and arguments. |
|
|
throwing(Level level,
T t)
Logs an exception or error to be thrown. |
|
|
throwing(T t)
Logs an exception or error to be thrown. |
|
void |
trace(Marker marker,
Message msg)
Logs a message with the specific Marker at the TRACE level. |
|
void |
trace(Marker marker,
Message msg,
Throwable t)
Logs a message with the specific Marker at the TRACE level. |
|
void |
trace(Marker marker,
Object message)
Logs a message object with the TRACE level. |
|
void |
trace(Marker marker,
Object message,
Throwable t)
Logs a message at the TRACE level including the stack trace of the Throwable
t passed as parameter. |
|
void |
trace(Marker marker,
String message)
Logs a message object with the TRACE level. |
|
void |
trace(Marker marker,
String message,
Object... params)
Logs a message with parameters at the TRACE level. |
|
void |
trace(Marker marker,
String message,
Throwable t)
Logs a message at the TRACE level including the stack trace of the Throwable
t passed as parameter. |
|
void |
trace(Message msg)
Logs a message with the specific Marker at the TRACE level. |
|
void |
trace(Message msg,
Throwable t)
Logs a message with the specific Marker at the TRACE level. |
|
void |
trace(Object message)
Logs a message object with the TRACE level. |
|
void |
trace(Object message,
Throwable t)
Logs a message at the TRACE level including the stack trace of the Throwable
t passed as parameter. |
|
void |
trace(String message)
Logs a message object with the TRACE level. |
|
void |
trace(String message,
Object... params)
Logs a message with parameters at the TRACE level. |
|
void |
trace(String message,
Throwable t)
Logs a message at the TRACE level including the stack trace of the Throwable
t passed as parameter. |
|
void |
warn(Marker marker,
Message msg)
Logs a message with the specific Marker at the WARN level. |
|
void |
warn(Marker marker,
Message msg,
Throwable t)
Logs a message with the specific Marker at the WARN level. |
|
void |
warn(Marker marker,
Object message)
Logs a message object with the WARN level. |
|
void |
warn(Marker marker,
Object message,
Throwable t)
Logs a message at the WARN level including the stack trace of the Throwable
t passed as parameter. |
|
void |
warn(Marker marker,
String message)
Logs a message object with the WARN level. |
|
void |
warn(Marker marker,
String message,
Object... params)
Logs a message with parameters at the WARN level. |
|
void |
warn(Marker marker,
String message,
Throwable t)
Logs a message at the WARN level including the stack trace of the Throwable
t passed as parameter. |
|
void |
warn(Message msg)
Logs a message with the specific Marker at the WARN level. |
|
void |
warn(Message msg,
Throwable t)
Logs a message with the specific Marker at the WARN level. |
|
void |
warn(Object message)
Logs a message object with the WARN level. |
|
void |
warn(Object message,
Throwable t)
Logs a message at the WARN level including the stack trace of the Throwable
t passed as parameter. |
|
void |
warn(String message)
Logs a message object with the WARN level. |
|
void |
warn(String message,
Object... params)
Logs a message with parameters at the WARN level. |
|
void |
warn(String message,
Throwable t)
Logs a message at the WARN level including the stack trace of the Throwable
t passed as parameter. |
|
| Method Detail |
|---|
void catching(Level level,
Throwable t)
level - The logging Level.t - The Throwable.void catching(Throwable t)
main() method), this method is ideal for it.
t - The Throwable.
void debug(Marker marker,
Message msg)
DEBUG level.
marker - the marker data specific to this log statementmsg - the message string to be logged
void debug(Marker marker,
Message msg,
Throwable t)
DEBUG level.
marker - the marker data specific to this log statementmsg - the message string to be loggedt - A Throwable or null.
void debug(Marker marker,
Object message)
DEBUG level.
marker - the marker data specific to this log statementmessage - the message object to log.
void debug(Marker marker,
Object message,
Throwable t)
DEBUG level including the stack trace of the Throwable
t passed as parameter.
marker - the marker data specific to this log statementmessage - the message to log.t - the exception to log, including its stack trace.
void debug(Marker marker,
String message)
DEBUG level.
marker - the marker data specific to this log statementmessage - the message object to log.
void debug(Marker marker,
String message,
Object... params)
DEBUG level.
marker - the marker data specific to this log statementmessage - the message to log; the format depends on the message factory.params - parameters to the message.getMessageFactory()
void debug(Marker marker,
String message,
Throwable t)
DEBUG level including the stack trace of the Throwable
t passed as parameter.
marker - the marker data specific to this log statementmessage - the message to log.t - the exception to log, including its stack trace.void debug(Message msg)
DEBUG level.
msg - the message string to be logged
void debug(Message msg,
Throwable t)
DEBUG level.
msg - the message string to be loggedt - A Throwable or null.void debug(Object message)
DEBUG level.
message - the message object to log.
void debug(Object message,
Throwable t)
DEBUG level including the stack trace of the Throwable
t passed as parameter.
message - the message to log.t - the exception to log, including its stack trace.void debug(String message)
DEBUG level.
message - the message object to log.
void debug(String message,
Object... params)
DEBUG level.
message - the message to log; the format depends on the message factory.params - parameters to the message.getMessageFactory()
void debug(String message,
Throwable t)
DEBUG level including the stack trace of the Throwable
t passed as parameter.
message - the message to log.t - the exception to log, including its stack trace.void entry()
void entry(Object... params)
public void doSomething(String foo, int bar) {
LOGGER.entry(foo, bar);
// do something
}
The use of methods such as this are more effective when combined with aspect-oriented programming or other bytecode manipulation tools. It can be rather tedious (and messy) to use this type of method manually.
params - The parameters to the method.
TODO Use of varargs results in array creation which can be a substantial portion of no-op case. LogMF/LogSF
provides several overrides to avoid vararg except in edge cases. (RG) LogMF and LogSF implement these in
LogXF which calls logger.callAppenders. callAppenders is part of the implementation and cannot be used by
the API. Adding more methods here and in AbstractLogger is sufficient.
void error(Marker marker,
Message msg)
ERROR level.
marker - the marker data specific to this log statementmsg - the message string to be logged
void error(Marker marker,
Message msg,
Throwable t)
ERROR level.
marker - the marker data specific to this log statementmsg - the message string to be loggedt - A Throwable or null.
void error(Marker marker,
Object message)
ERROR level.
marker - the marker data specific to this log statement.message - the message object to log.
void error(Marker marker,
Object message,
Throwable t)
ERROR level including the stack trace of the Throwable
t passed as parameter.
marker - the marker data specific to this log statement.message - the message object to log.t - the exception to log, including its stack trace.
void error(Marker marker,
String message)
ERROR level.
marker - the marker data specific to this log statement.message - the message object to log.
void error(Marker marker,
String message,
Object... params)
ERROR level.
marker - the marker data specific to this log statement.message - the message to log; the format depends on the message factory.params - parameters to the message.TODO Likely to misinterpret existing log4j client code that intended to call info(Object,Throwable). Incurs
array creation expense on every call. (RG) I assume you meant error, not info. It isn't possible to be
misinterpreted as the previous method is for that signature. Methods should be added to avoid varargs for
1, 2 or 3 parameters.
void error(Marker marker,
String message,
Throwable t)
ERROR level including the stack trace of the Throwable
t passed as parameter.
marker - the marker data specific to this log statement.message - the message object to log.t - the exception to log, including its stack trace.void error(Message msg)
ERROR level.
msg - the message string to be logged
void error(Message msg,
Throwable t)
ERROR level.
msg - the message string to be loggedt - A Throwable or null.void error(Object message)
ERROR level.
message - the message object to log.
void error(Object message,
Throwable t)
ERROR level including the stack trace of the Throwable
t passed as parameter.
message - the message object to log.t - the exception to log, including its stack trace.void error(String message)
ERROR level.
message - the message object to log.
void error(String message,
Object... params)
ERROR level.
message - the message to log; the format depends on the message factory.params - parameters to the message.TODO Likely to misinterpret existing log4j client code that intended to call info(Object,Throwable). Incurs
array creation expense on every call. (RG) I assume you meant error, not info. It isn't possible to be
misinterpreted as the previous method is for that signature. Methods should be added to avoid varargs for
1, 2 or 3 parameters.
void error(String message,
Throwable t)
ERROR level including the stack trace of the Throwable
t passed as parameter.
message - the message object to log.t - the exception to log, including its stack trace.void exit()
<R> R exit(R result)
return LOGGER.exit(myResult);
R - The type of the parameter and object being returned.result - The result being returned from the method call.
void fatal(Marker marker,
Message msg)
FATAL level.
marker - the marker data specific to this log statementmsg - the message string to be logged
void fatal(Marker marker,
Message msg,
Throwable t)
FATAL level.
marker - the marker data specific to this log statementmsg - the message string to be loggedt - A Throwable or null.
void fatal(Marker marker,
Object message)
FATAL level.
marker - The marker data specific to this log statement.message - the message object to log.
void fatal(Marker marker,
Object message,
Throwable t)
FATAL level including the stack trace of the Throwable
t passed as parameter.
marker - The marker data specific to this log statement.message - the message object to log.t - the exception to log, including its stack trace.
void fatal(Marker marker,
String message)
FATAL level.
marker - The marker data specific to this log statement.message - the message object to log.
void fatal(Marker marker,
String message,
Object... params)
FATAL level.
marker - The marker data specific to this log statement.message - the message to log; the format depends on the message factory.params - parameters to the message.TODO Likely to misinterpret existing log4j client code that intended to call info(Object,Throwable). Incurs
array creation expense on every call.(RG) I assume you meant fatal, not info. It isn't possible to be
misinterpreted as the previous method is for that signature. Methods should be added to avoid varargs for
1, 2 or 3 parameters.
void fatal(Marker marker,
String message,
Throwable t)
FATAL level including the stack trace of the Throwable
t passed as parameter.
marker - The marker data specific to this log statement.message - the message object to log.t - the exception to log, including its stack trace.void fatal(Message msg)
FATAL level.
msg - the message string to be logged
void fatal(Message msg,
Throwable t)
FATAL level.
msg - the message string to be loggedt - A Throwable or null.void fatal(Object message)
FATAL level.
message - the message object to log.
void fatal(Object message,
Throwable t)
FATAL level including the stack trace of the Throwable
t passed as parameter.
message - the message object to log.t - the exception to log, including its stack trace.void fatal(String message)
FATAL level.
message - the message object to log.
void fatal(String message,
Object... params)
FATAL level.
message - the message to log; the format depends on the message factory.params - parameters to the message.TODO Likely to misinterpret existing log4j client code that intended to call info(Object,Throwable). Incurs
array creation expense on every call.(RG) I assume you meant fatal, not info. It isn't possible to be
misinterpreted as the previous method is for that signature. Methods should be added to avoid varargs for
1, 2 or 3 parameters.
void fatal(String message,
Throwable t)
FATAL level including the stack trace of the Throwable
t passed as parameter.
message - the message object to log.t - the exception to log, including its stack trace.Level getLevel()
MessageFactory getMessageFactory()
String getName()
void info(Marker marker,
Message msg)
INFO level.
marker - the marker data specific to this log statementmsg - the message string to be logged
void info(Marker marker,
Message msg,
Throwable t)
INFO level.
marker - the marker data specific to this log statementmsg - the message string to be loggedt - A Throwable or null.
void info(Marker marker,
Object message)
INFO level.
marker - the marker data specific to this log statementmessage - the message object to log.
void info(Marker marker,
Object message,
Throwable t)
INFO level including the stack trace of the Throwable
t passed as parameter.
marker - the marker data specific to this log statementmessage - the message object to log.t - the exception to log, including its stack trace.
void info(Marker marker,
String message)
INFO level.
marker - the marker data specific to this log statementmessage - the message object to log.
void info(Marker marker,
String message,
Object... params)
INFO level.
marker - the marker data specific to this log statementmessage - the message to log; the format depends on the message factory.params - parameters to the message.TODO Likely to misinterpret existing log4j client code that intended to call info(Object,Throwable). Incurs
array creation expense on every call. (RG) It isn't possible to be misinterpreted as the previous method
is for that signature. Methods should be added to avoid varargs for 1, 2 or 3 parameters.
void info(Marker marker,
String message,
Throwable t)
INFO level including the stack trace of the Throwable
t passed as parameter.
marker - the marker data specific to this log statementmessage - the message object to log.t - the exception to log, including its stack trace.void info(Message msg)
INFO level.
msg - the message string to be logged
void info(Message msg,
Throwable t)
INFO level.
msg - the message string to be loggedt - A Throwable or null.void info(Object message)
INFO level.
message - the message object to log.
void info(Object message,
Throwable t)
INFO level including the stack trace of the Throwable
t passed as parameter.
message - the message object to log.t - the exception to log, including its stack trace.void info(String message)
INFO level.
message - the message object to log.
void info(String message,
Object... params)
INFO level.
message - the message to log; the format depends on the message factory.params - parameters to the message.TODO Likely to misinterpret existing log4j client code that intended to call info(Object,Throwable). Incurs
array creation expense on every call. (RG) It isn't possible to be misinterpreted as the previous method
is for that signature. Methods should be added to avoid varargs for 1, 2 or 3 parameters.
void info(String message,
Throwable t)
INFO level including the stack trace of the Throwable
t passed as parameter.
message - the message object to log.t - the exception to log, including its stack trace.boolean isDebugEnabled()
DEBUG Level.
true if this Logger is enabled for level DEBUG, false otherwise.boolean isDebugEnabled(Marker marker)
DEBUG Level.
marker - The marker data specific to this log statement.
true if this Logger is enabled for level DEBUG, false otherwise.boolean isEnabled(Level level)
Note that passing in OFF always returns true.
level - the level to check
true if this Logger is enabled for level, false otherwise.
boolean isEnabled(Level level,
Marker marker)
level - The Level to check.marker - The marker data specific to this log statement.
true if this Logger is enabled for level WARN, false
otherwise.boolean isErrorEnabled()
ERROR Level.
true if this Logger is enabled for level ERROR, false
otherwise.boolean isErrorEnabled(Marker marker)
ERROR Level.
marker - The marker data specific to this log statement.
true if this Logger is enabled for level ERROR, false
otherwise.boolean isFatalEnabled()
FATAL Level.
true if this Logger is enabled for level FATAL, false
otherwise.boolean isFatalEnabled(Marker marker)
FATAL Level.
marker - The marker data specific to this log statement.
true if this Logger is enabled for level FATAL, false
otherwise.boolean isInfoEnabled()
INFO Level.
true if this Logger is enabled for level INFO, false otherwise.boolean isInfoEnabled(Marker marker)
INFO Level.
marker - The marker data specific to this log statement.
true if this Logger is enabled for level INFO, false otherwise.boolean isTraceEnabled()
TRACE level.
true if this Logger is enabled for level TRACE, false otherwise.boolean isTraceEnabled(Marker marker)
TRACE level.
marker - The marker data specific to this log statement.
true if this Logger is enabled for level TRACE, false otherwise.boolean isWarnEnabled()
WARN Level.
true if this Logger is enabled for level WARN, false
otherwise.boolean isWarnEnabled(Marker marker)
WARN Level.
marker - The marker data specific to this log statement.
true if this Logger is enabled for level WARN, false
otherwise.
void log(Level level,
Marker marker,
Message msg)
level - the logging levelmarker - the marker data specific to this log statementmsg - the message string to be logged
void log(Level level,
Marker marker,
Message msg,
Throwable t)
level - the logging levelmarker - the marker data specific to this log statementmsg - the message string to be loggedt - A Throwable or null.
void log(Level level,
Marker marker,
Object message)
level - the logging levelmarker - the marker data specific to this log statementmessage - the message object to log.
void log(Level level,
Marker marker,
Object message,
Throwable t)
Throwable t passed as
parameter.
level - the logging levelmarker - the marker data specific to this log statementmessage - the message to log.t - the exception to log, including its stack trace.
void log(Level level,
Marker marker,
String message)
level - the logging levelmarker - the marker data specific to this log statementmessage - the message object to log.
void log(Level level,
Marker marker,
String message,
Object... params)
level - the logging levelmarker - the marker data specific to this log statementmessage - the message to log; the format depends on the message factory.params - parameters to the message.getMessageFactory()
void log(Level level,
Marker marker,
String message,
Throwable t)
Throwable t passed as
parameter.
level - the logging levelmarker - the marker data specific to this log statementmessage - the message to log.t - the exception to log, including its stack trace.
void log(Level level,
Message msg)
level - the logging levelmsg - the message string to be logged
void log(Level level,
Message msg,
Throwable t)
level - the logging levelmsg - the message string to be loggedt - A Throwable or null.
void log(Level level,
Object message)
level - the logging levelmessage - the message object to log.
void log(Level level,
Object message,
Throwable t)
Throwable t passed as
parameter.
level - the logging levelmessage - the message to log.t - the exception to log, including its stack trace.
void log(Level level,
String message)
level - the logging levelmessage - the message object to log.
void log(Level level,
String message,
Object... params)
level - the logging levelmessage - the message to log; the format depends on the message factory.params - parameters to the message.getMessageFactory()
void log(Level level,
String message,
Throwable t)
Throwable t passed as
parameter.
level - the logging levelmessage - the message to log.t - the exception to log, including its stack trace.
void printf(Level level,
Marker marker,
String format,
Object... params)
level - The logging Level.marker - the marker data specific to this log statement.format - The format String.params - Arguments specified by the format.
void printf(Level level,
String format,
Object... params)
level - The logging Level.format - The format String.params - Arguments specified by the format.
<T extends Throwable> T throwing(Level level,
T t)
throw logger.throwing(Level.DEBUG, myException);
T - the Throwable type.level - The logging Level.t - The Throwable.
<T extends Throwable> T throwing(T t)
throw logger.throwing(myException);
T - the Throwable type.t - The Throwable.
void trace(Marker marker,
Message msg)
TRACE level.
marker - the marker data specific to this log statementmsg - the message string to be logged
void trace(Marker marker,
Message msg,
Throwable t)
TRACE level.
marker - the marker data specific to this log statementmsg - the message string to be loggedt - A Throwable or null.
void trace(Marker marker,
Object message)
TRACE level.
marker - the marker data specific to this log statementmessage - the message object to log.
void trace(Marker marker,
Object message,
Throwable t)
TRACE level including the stack trace of the Throwable
t passed as parameter.
marker - the marker data specific to this log statementmessage - the message object to log.t - the exception to log, including its stack trace.debug(String)
void trace(Marker marker,
String message)
TRACE level.
marker - the marker data specific to this log statementmessage - the message object to log.
void trace(Marker marker,
String message,
Object... params)
TRACE level.
marker - the marker data specific to this log statementmessage - the message to log; the format depends on the message factory.params - parameters to the message.getMessageFactory()
void trace(Marker marker,
String message,
Throwable t)
TRACE level including the stack trace of the Throwable
t passed as parameter.
marker - the marker data specific to this log statementmessage - the message object to log.t - the exception to log, including its stack trace.debug(String)void trace(Message msg)
TRACE level.
msg - the message string to be logged
void trace(Message msg,
Throwable t)
TRACE level.
msg - the message string to be loggedt - A Throwable or null.void trace(Object message)
TRACE level.
message - the message object to log.
void trace(Object message,
Throwable t)
TRACE level including the stack trace of the Throwable
t passed as parameter.
message - the message object to log.t - the exception to log, including its stack trace.debug(String)void trace(String message)
TRACE level.
message - the message object to log.
void trace(String message,
Object... params)
TRACE level.
message - the message to log; the format depends on the message factory.params - parameters to the message.getMessageFactory()
void trace(String message,
Throwable t)
TRACE level including the stack trace of the Throwable
t passed as parameter.
message - the message object to log.t - the exception to log, including its stack trace.debug(String)
void warn(Marker marker,
Message msg)
WARN level.
marker - the marker data specific to this log statementmsg - the message string to be logged
void warn(Marker marker,
Message msg,
Throwable t)
WARN level.
marker - the marker data specific to this log statementmsg - the message string to be loggedt - A Throwable or null.
void warn(Marker marker,
Object message)
WARN level.
marker - the marker data specific to this log statementmessage - the message object to log.
void warn(Marker marker,
Object message,
Throwable t)
WARN level including the stack trace of the Throwable
t passed as parameter.
marker - the marker data specific to this log statementmessage - the message object to log.t - the exception to log, including its stack trace.
void warn(Marker marker,
String message)
WARN level.
marker - the marker data specific to this log statementmessage - the message object to log.
void warn(Marker marker,
String message,
Object... params)
WARN level.
marker - the marker data specific to this log statement.message - the message to log; the format depends on the message factory.params - parameters to the message.TODO Likely to misinterpret existing log4j client code that intended to call info(Object,Throwable). Incurs
array creation expense on every call. (RG) I assume you meant warn, not info. It isn't possible to be
misinterpreted as the previous method is for that signature.Methods should be added to avoid varargs for
1, 2 or 3 parameters.
void warn(Marker marker,
String message,
Throwable t)
WARN level including the stack trace of the Throwable
t passed as parameter.
marker - the marker data specific to this log statementmessage - the message object to log.t - the exception to log, including its stack trace.void warn(Message msg)
WARN level.
msg - the message string to be logged
void warn(Message msg,
Throwable t)
WARN level.
msg - the message string to be loggedt - A Throwable or null.void warn(Object message)
WARN level.
message - the message object to log.
void warn(Object message,
Throwable t)
WARN level including the stack trace of the Throwable
t passed as parameter.
message - the message object to log.t - the exception to log, including its stack trace.void warn(String message)
WARN level.
message - the message object to log.
void warn(String message,
Object... params)
WARN level.
message - the message to log; the format depends on the message factory.params - parameters to the message.TODO Likely to misinterpret existing log4j client code that intended to call info(Object,Throwable). Incurs
array creation expense on every call. (RG) I assume you meant warn, not info. It isn't possible to be
misinterpreted as the previous method is for that signature.Methods should be added to avoid varargs for
1, 2 or 3 parameters.
void warn(String message,
Throwable t)
WARN level including the stack trace of the Throwable
t passed as parameter.
message - the message object to log.t - the exception to log, including its stack trace.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright © 1999-2014 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.