|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.logging.log4j.spi.AbstractLogger
public abstract class AbstractLogger
Base implementation of a Logger. It is highly recommended that any Logger implementation extend this class.
Field Summary | |
---|---|
static Marker |
CATCHING_MARKER
Marker for catching exceptions. |
static Class<? extends MessageFactory> |
DEFAULT_MESSAGE_FACTORY_CLASS
The default MessageFactory class. |
static Marker |
ENTRY_MARKER
Marker for method entry tracing. |
static Marker |
EXCEPTION_MARKER
Marker for exception tracing. |
static Marker |
EXIT_MARKER
Marker for method exit tracing. |
static Marker |
FLOW_MARKER
Marker for flow tracing. |
static Marker |
THROWING_MARKER
Marker for throwing exceptions. |
Constructor Summary | |
---|---|
AbstractLogger()
Creates a new logger named after this class (or subclass). |
|
AbstractLogger(String name)
Creates a new named logger. |
|
AbstractLogger(String name,
MessageFactory messageFactory)
Creates a new named logger with a particular MessageFactory . |
Method Summary | ||
---|---|---|
void |
catching(Level level,
Throwable t)
Logs an exception or error that has been caught to a specific logging level. |
|
protected void |
catching(String fqcn,
Level level,
Throwable t)
Logs a Throwable that has been caught with location information. |
|
void |
catching(Throwable t)
Logs an exception or error that has been caught. |
|
protected Message |
catchingMsg(Throwable t)
|
|
static void |
checkMessageFactory(ExtendedLogger logger,
MessageFactory messageFactory)
Checks that the message factory a logger was created with is the same as the given messageFactory. |
|
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. |
|
protected void |
entry(String fqcn,
Object... params)
Logs entry to a method with location information. |
|
protected Message |
entryMsg(int count,
Object... params)
|
|
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. |
|
protected
|
exit(String fqcn,
R result)
Logs exiting from a method with the result and location information. |
|
protected Message |
exitMsg(Object 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. |
|
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 |
logIfEnabled(String fqcn,
Level level,
Marker marker,
Message msg,
Throwable t)
Logs a message if the specified level is active. |
|
void |
logIfEnabled(String fqcn,
Level level,
Marker marker,
Object message,
Throwable t)
Logs a message if the specified level is active. |
|
void |
logIfEnabled(String fqcn,
Level level,
Marker marker,
String message)
Logs a message if the specified level is active. |
|
void |
logIfEnabled(String fqcn,
Level level,
Marker marker,
String message,
Object... params)
Logs a message if the specified level is active. |
|
void |
logIfEnabled(String fqcn,
Level level,
Marker marker,
String message,
Throwable t)
Logs a message if the specified level is active. |
|
protected void |
logMessage(String fqcn,
Level level,
Marker marker,
Object message,
Throwable t)
|
|
protected void |
logMessage(String fqcn,
Level level,
Marker marker,
String message)
|
|
protected void |
logMessage(String fqcn,
Level level,
Marker marker,
String message,
Object... params)
|
|
protected void |
logMessage(String fqcn,
Level level,
Marker marker,
String message,
Throwable t)
|
|
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. |
|
protected
|
throwing(String fqcn,
Level level,
T t)
Logs a Throwable to be thrown. |
|
|
throwing(T t)
Logs an exception or error to be thrown. |
|
protected Message |
throwingMsg(Throwable t)
|
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.logging.log4j.spi.ExtendedLogger |
---|
isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, logMessage |
Methods inherited from interface org.apache.logging.log4j.Logger |
---|
getLevel |
Field Detail |
---|
public static final Marker FLOW_MARKER
public static final Marker ENTRY_MARKER
public static final Marker EXIT_MARKER
public static final Marker EXCEPTION_MARKER
public static final Marker THROWING_MARKER
public static final Marker CATCHING_MARKER
public static final Class<? extends MessageFactory> DEFAULT_MESSAGE_FACTORY_CLASS
Constructor Detail |
---|
public AbstractLogger()
public AbstractLogger(String name)
name
- the logger namepublic AbstractLogger(String name, MessageFactory messageFactory)
MessageFactory
.
name
- the logger namemessageFactory
- the message factory, if null then use the default message factory.Method Detail |
---|
public static void checkMessageFactory(ExtendedLogger logger, MessageFactory messageFactory)
DEFAULT_MESSAGE_FACTORY_CLASS
.
logger
- The logger to checkmessageFactory
- The message factory to check.public void catching(Level level, Throwable t)
Logger
catching
in interface Logger
level
- The logging Level.t
- The Throwable.protected void catching(String fqcn, Level level, Throwable t)
fqcn
- The fully qualified class name of the caller.level
- The logging level.t
- The Throwable.public void catching(Throwable t)
Logger
main()
method), this method is ideal for it.
catching
in interface Logger
t
- The Throwable.protected Message catchingMsg(Throwable t)
public void debug(Marker marker, Message msg)
Logger
DEBUG
level.
debug
in interface Logger
marker
- the marker data specific to this log statementmsg
- the message string to be loggedpublic void debug(Marker marker, Message msg, Throwable t)
Logger
DEBUG
level.
debug
in interface Logger
marker
- the marker data specific to this log statementmsg
- the message string to be loggedt
- A Throwable or null.public void debug(Marker marker, Object message)
Logger
DEBUG
level.
debug
in interface Logger
marker
- the marker data specific to this log statementmessage
- the message object to log.public void debug(Marker marker, Object message, Throwable t)
Logger
DEBUG
level including the stack trace of the Throwable
t
passed as parameter.
debug
in interface Logger
marker
- the marker data specific to this log statementmessage
- the message to log.t
- the exception to log, including its stack trace.public void debug(Marker marker, String message)
Logger
DEBUG
level.
debug
in interface Logger
marker
- the marker data specific to this log statementmessage
- the message object to log.public void debug(Marker marker, String message, Object... params)
Logger
DEBUG
level.
debug
in interface Logger
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.Logger.getMessageFactory()
public void debug(Marker marker, String message, Throwable t)
Logger
DEBUG
level including the stack trace of the Throwable
t
passed as parameter.
debug
in interface Logger
marker
- the marker data specific to this log statementmessage
- the message to log.t
- the exception to log, including its stack trace.public void debug(Message msg)
Logger
DEBUG
level.
debug
in interface Logger
msg
- the message string to be loggedpublic void debug(Message msg, Throwable t)
Logger
DEBUG
level.
debug
in interface Logger
msg
- the message string to be loggedt
- A Throwable or null.public void debug(Object message)
Logger
DEBUG
level.
debug
in interface Logger
message
- the message object to log.public void debug(Object message, Throwable t)
Logger
DEBUG
level including the stack trace of the Throwable
t
passed as parameter.
debug
in interface Logger
message
- the message to log.t
- the exception to log, including its stack trace.public void debug(String message)
Logger
DEBUG
level.
debug
in interface Logger
message
- the message string to log.public void debug(String message, Object... params)
Logger
DEBUG
level.
debug
in interface Logger
message
- the message to log; the format depends on the message factory.params
- parameters to the message.Logger.getMessageFactory()
public void debug(String message, Throwable t)
Logger
DEBUG
level including the stack trace of the Throwable
t
passed as parameter.
debug
in interface Logger
message
- the message to log.t
- the exception to log, including its stack trace.public void entry()
Logger
entry
in interface Logger
public void entry(Object... params)
Logger
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.
entry
in interface Logger
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.protected void entry(String fqcn, Object... params)
fqcn
- The fully qualified class name of the caller.params
- The parameters to the method.protected Message entryMsg(int count, Object... params)
public void error(Marker marker, Message msg)
Logger
ERROR
level.
error
in interface Logger
marker
- the marker data specific to this log statementmsg
- the message string to be loggedpublic void error(Marker marker, Message msg, Throwable t)
Logger
ERROR
level.
error
in interface Logger
marker
- the marker data specific to this log statementmsg
- the message string to be loggedt
- A Throwable or null.public void error(Marker marker, Object message)
Logger
ERROR
level.
error
in interface Logger
marker
- the marker data specific to this log statement.message
- the message object to log.public void error(Marker marker, Object message, Throwable t)
Logger
ERROR
level including the stack trace of the Throwable
t
passed as parameter.
error
in interface Logger
marker
- the marker data specific to this log statement.message
- the message object to log.t
- the exception to log, including its stack trace.public void error(Marker marker, String message)
Logger
ERROR
level.
error
in interface Logger
marker
- the marker data specific to this log statement.message
- the message object to log.public void error(Marker marker, String message, Object... params)
Logger
ERROR
level.
error
in interface Logger
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.
public void error(Marker marker, String message, Throwable t)
Logger
ERROR
level including the stack trace of the Throwable
t
passed as parameter.
error
in interface Logger
marker
- the marker data specific to this log statement.message
- the message object to log.t
- the exception to log, including its stack trace.public void error(Message msg)
Logger
ERROR
level.
error
in interface Logger
msg
- the message string to be loggedpublic void error(Message msg, Throwable t)
Logger
ERROR
level.
error
in interface Logger
msg
- the message string to be loggedt
- A Throwable or null.public void error(Object message)
Logger
ERROR
level.
error
in interface Logger
message
- the message object to log.public void error(Object message, Throwable t)
Logger
ERROR
level including the stack trace of the Throwable
t
passed as parameter.
error
in interface Logger
message
- the message object to log.t
- the exception to log, including its stack trace.public void error(String message)
Logger
ERROR
level.
error
in interface Logger
message
- the message string to log.public void error(String message, Object... params)
Logger
ERROR
level.
error
in interface Logger
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.
public void error(String message, Throwable t)
Logger
ERROR
level including the stack trace of the Throwable
t
passed as parameter.
error
in interface Logger
message
- the message object to log.t
- the exception to log, including its stack trace.public void exit()
Logger
exit
in interface Logger
public <R> R exit(R result)
Logger
return LOGGER.exit(myResult);
exit
in interface Logger
R
- The type of the parameter and object being returned.result
- The result being returned from the method call.
protected <R> R exit(String fqcn, R result)
R
- The type of the parameter and object being returned.fqcn
- The fully qualified class name of the caller.result
- The result being returned from the method call.
protected Message exitMsg(Object result)
public void fatal(Marker marker, Message msg)
Logger
FATAL
level.
fatal
in interface Logger
marker
- the marker data specific to this log statementmsg
- the message string to be loggedpublic void fatal(Marker marker, Message msg, Throwable t)
Logger
FATAL
level.
fatal
in interface Logger
marker
- the marker data specific to this log statementmsg
- the message string to be loggedt
- A Throwable or null.public void fatal(Marker marker, Object message)
Logger
FATAL
level.
fatal
in interface Logger
marker
- The marker data specific to this log statement.message
- the message object to log.public void fatal(Marker marker, Object message, Throwable t)
Logger
FATAL
level including the stack trace of the Throwable
t
passed as parameter.
fatal
in interface Logger
marker
- The marker data specific to this log statement.message
- the message object to log.t
- the exception to log, including its stack trace.public void fatal(Marker marker, String message)
Logger
FATAL
level.
fatal
in interface Logger
marker
- The marker data specific to this log statement.message
- the message object to log.public void fatal(Marker marker, String message, Object... params)
Logger
FATAL
level.
fatal
in interface Logger
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.
public void fatal(Marker marker, String message, Throwable t)
Logger
FATAL
level including the stack trace of the Throwable
t
passed as parameter.
fatal
in interface Logger
marker
- The marker data specific to this log statement.message
- the message object to log.t
- the exception to log, including its stack trace.public void fatal(Message msg)
Logger
FATAL
level.
fatal
in interface Logger
msg
- the message string to be loggedpublic void fatal(Message msg, Throwable t)
Logger
FATAL
level.
fatal
in interface Logger
msg
- the message string to be loggedt
- A Throwable or null.public void fatal(Object message)
Logger
FATAL
level.
fatal
in interface Logger
message
- the message object to log.public void fatal(Object message, Throwable t)
Logger
FATAL
level including the stack trace of the Throwable
t
passed as parameter.
fatal
in interface Logger
message
- the message object to log.t
- the exception to log, including its stack trace.public void fatal(String message)
Logger
FATAL
level.
fatal
in interface Logger
message
- the message string to log.public void fatal(String message, Object... params)
Logger
FATAL
level.
fatal
in interface Logger
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.
public void fatal(String message, Throwable t)
Logger
FATAL
level including the stack trace of the Throwable
t
passed as parameter.
fatal
in interface Logger
message
- the message object to log.t
- the exception to log, including its stack trace.public MessageFactory getMessageFactory()
Logger
getMessageFactory
in interface Logger
public String getName()
Logger
getName
in interface Logger
public void info(Marker marker, Message msg)
Logger
INFO
level.
info
in interface Logger
marker
- the marker data specific to this log statementmsg
- the message string to be loggedpublic void info(Marker marker, Message msg, Throwable t)
Logger
INFO
level.
info
in interface Logger
marker
- the marker data specific to this log statementmsg
- the message string to be loggedt
- A Throwable or null.public void info(Marker marker, Object message)
Logger
INFO
level.
info
in interface Logger
marker
- the marker data specific to this log statementmessage
- the message object to log.public void info(Marker marker, Object message, Throwable t)
Logger
INFO
level including the stack trace of the Throwable
t
passed as parameter.
info
in interface Logger
marker
- the marker data specific to this log statementmessage
- the message object to log.t
- the exception to log, including its stack trace.public void info(Marker marker, String message)
Logger
INFO
level.
info
in interface Logger
marker
- the marker data specific to this log statementmessage
- the message object to log.public void info(Marker marker, String message, Object... params)
Logger
INFO
level.
info
in interface Logger
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.
public void info(Marker marker, String message, Throwable t)
Logger
INFO
level including the stack trace of the Throwable
t
passed as parameter.
info
in interface Logger
marker
- the marker data specific to this log statementmessage
- the message object to log.t
- the exception to log, including its stack trace.public void info(Message msg)
Logger
INFO
level.
info
in interface Logger
msg
- the message string to be loggedpublic void info(Message msg, Throwable t)
Logger
INFO
level.
info
in interface Logger
msg
- the message string to be loggedt
- A Throwable or null.public void info(Object message)
Logger
INFO
level.
info
in interface Logger
message
- the message object to log.public void info(Object message, Throwable t)
Logger
INFO
level including the stack trace of the Throwable
t
passed as parameter.
info
in interface Logger
message
- the message object to log.t
- the exception to log, including its stack trace.public void info(String message)
Logger
INFO
level.
info
in interface Logger
message
- the message string to log.public void info(String message, Object... params)
Logger
INFO
level.
info
in interface Logger
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.
public void info(String message, Throwable t)
Logger
INFO
level including the stack trace of the Throwable
t
passed as parameter.
info
in interface Logger
message
- the message object to log.t
- the exception to log, including its stack trace.public boolean isDebugEnabled()
Logger
DEBUG
Level.
isDebugEnabled
in interface Logger
true
if this Logger is enabled for level DEBUG, false
otherwise.public boolean isDebugEnabled(Marker marker)
Logger
DEBUG
Level.
isDebugEnabled
in interface Logger
marker
- The marker data specific to this log statement.
true
if this Logger is enabled for level DEBUG, false
otherwise.public boolean isEnabled(Level level)
Logger
Note that passing in OFF
always returns true
.
isEnabled
in interface Logger
level
- the level to check
true
if this Logger is enabled for level, false
otherwise.public boolean isEnabled(Level level, Marker marker)
Logger
isEnabled
in interface Logger
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.public boolean isErrorEnabled()
Logger
ERROR
Level.
isErrorEnabled
in interface Logger
true
if this Logger is enabled for level ERROR
, false
otherwise.public boolean isErrorEnabled(Marker marker)
Logger
ERROR
Level.
isErrorEnabled
in interface Logger
marker
- The marker data specific to this log statement.
true
if this Logger is enabled for level ERROR
, false
otherwise.public boolean isFatalEnabled()
Logger
FATAL
Level.
isFatalEnabled
in interface Logger
true
if this Logger is enabled for level FATAL
, false
otherwise.public boolean isFatalEnabled(Marker marker)
Logger
FATAL
Level.
isFatalEnabled
in interface Logger
marker
- The marker data specific to this log statement.
true
if this Logger is enabled for level FATAL
, false
otherwise.public boolean isInfoEnabled()
Logger
INFO
Level.
isInfoEnabled
in interface Logger
true
if this Logger is enabled for level INFO, false
otherwise.public boolean isInfoEnabled(Marker marker)
Logger
INFO
Level.
isInfoEnabled
in interface Logger
marker
- The marker data specific to this log statement.
true
if this Logger is enabled for level INFO, false
otherwise.public boolean isTraceEnabled()
Logger
TRACE
level.
isTraceEnabled
in interface Logger
true
if this Logger is enabled for level TRACE, false
otherwise.public boolean isTraceEnabled(Marker marker)
Logger
TRACE
level.
isTraceEnabled
in interface Logger
marker
- The marker data specific to this log statement.
true
if this Logger is enabled for level TRACE, false
otherwise.public boolean isWarnEnabled()
Logger
WARN
Level.
isWarnEnabled
in interface Logger
true
if this Logger is enabled for level WARN
, false
otherwise.public boolean isWarnEnabled(Marker marker)
Logger
WARN
Level.
isWarnEnabled
in interface Logger
marker
- The marker data specific to this log statement.
true
if this Logger is enabled for level WARN
, false
otherwise.public void log(Level level, Marker marker, Message msg)
Logger
log
in interface Logger
level
- the logging levelmarker
- the marker data specific to this log statementmsg
- the message string to be loggedpublic void log(Level level, Marker marker, Message msg, Throwable t)
Logger
log
in interface Logger
level
- the logging levelmarker
- the marker data specific to this log statementmsg
- the message string to be loggedt
- A Throwable or null.public void log(Level level, Marker marker, Object message)
Logger
log
in interface Logger
level
- the logging levelmarker
- the marker data specific to this log statementmessage
- the message object to log.public void log(Level level, Marker marker, Object message, Throwable t)
Logger
Throwable
t
passed as
parameter.
log
in interface Logger
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.public void log(Level level, Marker marker, String message)
Logger
log
in interface Logger
level
- the logging levelmarker
- the marker data specific to this log statementmessage
- the message object to log.public void log(Level level, Marker marker, String message, Object... params)
Logger
log
in interface Logger
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.Logger.getMessageFactory()
public void log(Level level, Marker marker, String message, Throwable t)
Logger
Throwable
t
passed as
parameter.
log
in interface Logger
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.public void log(Level level, Message msg)
Logger
log
in interface Logger
level
- the logging levelmsg
- the message string to be loggedpublic void log(Level level, Message msg, Throwable t)
Logger
log
in interface Logger
level
- the logging levelmsg
- the message string to be loggedt
- A Throwable or null.public void log(Level level, Object message)
Logger
log
in interface Logger
level
- the logging levelmessage
- the message object to log.public void log(Level level, Object message, Throwable t)
Logger
Throwable
t
passed as
parameter.
log
in interface Logger
level
- the logging levelmessage
- the message to log.t
- the exception to log, including its stack trace.public void log(Level level, String message)
Logger
log
in interface Logger
level
- the logging levelmessage
- the message string to log.public void log(Level level, String message, Object... params)
Logger
log
in interface Logger
level
- the logging levelmessage
- the message to log; the format depends on the message factory.params
- parameters to the message.Logger.getMessageFactory()
public void log(Level level, String message, Throwable t)
Logger
Throwable
t
passed as
parameter.
log
in interface Logger
level
- the logging levelmessage
- the message to log.t
- the exception to log, including its stack trace.public void logIfEnabled(String fqcn, Level level, Marker marker, Message msg, Throwable t)
ExtendedLogger
logIfEnabled
in interface ExtendedLogger
fqcn
- The fully qualified class name of the logger entry point, used to determine the caller class and
method when location information needs to be logged.level
- The logging Level to check.marker
- A Marker or null.msg
- The Message.t
- the exception to log, including its stack trace.public void logIfEnabled(String fqcn, Level level, Marker marker, Object message, Throwable t)
ExtendedLogger
logIfEnabled
in interface ExtendedLogger
fqcn
- The fully qualified class name of the logger entry point, used to determine the caller class and
method when location information needs to be logged.level
- The logging Level to check.marker
- A Marker or null.message
- The message.t
- the exception to log, including its stack trace.public void logIfEnabled(String fqcn, Level level, Marker marker, String message)
ExtendedLogger
logIfEnabled
in interface ExtendedLogger
fqcn
- The fully qualified class name of the logger entry point, used to determine the caller class and
method when location information needs to be logged.level
- The logging Level to check.marker
- A Marker or null.message
- The message.public void logIfEnabled(String fqcn, Level level, Marker marker, String message, Object... params)
ExtendedLogger
logIfEnabled
in interface ExtendedLogger
fqcn
- The fully qualified class name of the logger entry point, used to determine the caller class and
method when location information needs to be logged.level
- The logging Level to check.marker
- A Marker or null.message
- The message format.params
- The message parameters.public void logIfEnabled(String fqcn, Level level, Marker marker, String message, Throwable t)
ExtendedLogger
logIfEnabled
in interface ExtendedLogger
fqcn
- The fully qualified class name of the logger entry point, used to determine the caller class and
method when location information needs to be logged.level
- The logging Level to check.marker
- A Marker or null.message
- The message.t
- the exception to log, including its stack trace.protected void logMessage(String fqcn, Level level, Marker marker, Object message, Throwable t)
protected void logMessage(String fqcn, Level level, Marker marker, String message, Throwable t)
protected void logMessage(String fqcn, Level level, Marker marker, String message)
protected void logMessage(String fqcn, Level level, Marker marker, String message, Object... params)
public void printf(Level level, Marker marker, String format, Object... params)
Logger
printf
in interface Logger
level
- The logging Level.marker
- the marker data specific to this log statement.format
- The format String.params
- Arguments specified by the format.public void printf(Level level, String format, Object... params)
Logger
printf
in interface Logger
level
- The logging Level.format
- The format String.params
- Arguments specified by the format.public <T extends Throwable> T throwing(T t)
Logger
throw logger.throwing(myException);
throwing
in interface Logger
T
- the Throwable type.t
- The Throwable.
public <T extends Throwable> T throwing(Level level, T t)
Logger
throw logger.throwing(Level.DEBUG, myException);
throwing
in interface Logger
T
- the Throwable type.level
- The logging Level.t
- The Throwable.
protected <T extends Throwable> T throwing(String fqcn, Level level, T t)
T
- the type of the Throwable.fqcn
- the fully qualified class name of this Logger implementation.level
- The logging Level.t
- The Throwable.
protected Message throwingMsg(Throwable t)
public void trace(Marker marker, Message msg)
Logger
TRACE
level.
trace
in interface Logger
marker
- the marker data specific to this log statementmsg
- the message string to be loggedpublic void trace(Marker marker, Message msg, Throwable t)
Logger
TRACE
level.
trace
in interface Logger
marker
- the marker data specific to this log statementmsg
- the message string to be loggedt
- A Throwable or null.public void trace(Marker marker, Object message)
Logger
TRACE
level.
trace
in interface Logger
marker
- the marker data specific to this log statementmessage
- the message object to log.public void trace(Marker marker, Object message, Throwable t)
Logger
TRACE
level including the stack trace of the Throwable
t
passed as parameter.
trace
in interface Logger
marker
- the marker data specific to this log statementmessage
- the message object to log.t
- the exception to log, including its stack trace.Logger.debug(String)
public void trace(Marker marker, String message)
Logger
TRACE
level.
trace
in interface Logger
marker
- the marker data specific to this log statementmessage
- the message string to log.public void trace(Marker marker, String message, Object... params)
Logger
TRACE
level.
trace
in interface Logger
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.Logger.getMessageFactory()
public void trace(Marker marker, String message, Throwable t)
Logger
TRACE
level including the stack trace of the Throwable
t
passed as parameter.
trace
in interface Logger
marker
- the marker data specific to this log statementmessage
- the message object to log.t
- the exception to log, including its stack trace.Logger.debug(String)
public void trace(Message msg)
Logger
TRACE
level.
trace
in interface Logger
msg
- the message string to be loggedpublic void trace(Message msg, Throwable t)
Logger
TRACE
level.
trace
in interface Logger
msg
- the message string to be loggedt
- A Throwable or null.public void trace(Object message)
Logger
TRACE
level.
trace
in interface Logger
message
- the message object to log.public void trace(Object message, Throwable t)
Logger
TRACE
level including the stack trace of the Throwable
t
passed as parameter.
trace
in interface Logger
message
- the message object to log.t
- the exception to log, including its stack trace.Logger.debug(String)
public void trace(String message)
Logger
TRACE
level.
trace
in interface Logger
message
- the message string to log.public void trace(String message, Object... params)
Logger
TRACE
level.
trace
in interface Logger
message
- the message to log; the format depends on the message factory.params
- parameters to the message.Logger.getMessageFactory()
public void trace(String message, Throwable t)
Logger
TRACE
level including the stack trace of the Throwable
t
passed as parameter.
trace
in interface Logger
message
- the message object to log.t
- the exception to log, including its stack trace.Logger.debug(String)
public void warn(Marker marker, Message msg)
Logger
WARN
level.
warn
in interface Logger
marker
- the marker data specific to this log statementmsg
- the message string to be loggedpublic void warn(Marker marker, Message msg, Throwable t)
Logger
WARN
level.
warn
in interface Logger
marker
- the marker data specific to this log statementmsg
- the message string to be loggedt
- A Throwable or null.public void warn(Marker marker, Object message)
Logger
WARN
level.
warn
in interface Logger
marker
- the marker data specific to this log statementmessage
- the message object to log.public void warn(Marker marker, Object message, Throwable t)
Logger
WARN
level including the stack trace of the Throwable
t
passed as parameter.
warn
in interface Logger
marker
- the marker data specific to this log statementmessage
- the message object to log.t
- the exception to log, including its stack trace.public void warn(Marker marker, String message)
Logger
WARN
level.
warn
in interface Logger
marker
- the marker data specific to this log statementmessage
- the message object to log.public void warn(Marker marker, String message, Object... params)
Logger
WARN
level.
warn
in interface Logger
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.
public void warn(Marker marker, String message, Throwable t)
Logger
WARN
level including the stack trace of the Throwable
t
passed as parameter.
warn
in interface Logger
marker
- the marker data specific to this log statementmessage
- the message object to log.t
- the exception to log, including its stack trace.public void warn(Message msg)
Logger
WARN
level.
warn
in interface Logger
msg
- the message string to be loggedpublic void warn(Message msg, Throwable t)
Logger
WARN
level.
warn
in interface Logger
msg
- the message string to be loggedt
- A Throwable or null.public void warn(Object message)
Logger
WARN
level.
warn
in interface Logger
message
- the message object to log.public void warn(Object message, Throwable t)
Logger
WARN
level including the stack trace of the Throwable
t
passed as parameter.
warn
in interface Logger
message
- the message object to log.t
- the exception to log, including its stack trace.public void warn(String message)
Logger
WARN
level.
warn
in interface Logger
message
- the message string to log.public void warn(String message, Object... params)
Logger
WARN
level.
warn
in interface Logger
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.
public void warn(String message, Throwable t)
Logger
WARN
level including the stack trace of the Throwable
t
passed as parameter.
warn
in interface Logger
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-2015 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.