|
||||||||||
| 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 name
public 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 Loggerlevel - 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)
Loggermain() method), this method is ideal for it.
catching in interface Loggert - The Throwable.protected Message catchingMsg(Throwable t)
public void debug(Marker marker,
Message msg)
LoggerDEBUG level.
debug in interface Loggermarker - the marker data specific to this log statementmsg - the message string to be logged
public void debug(Marker marker,
Message msg,
Throwable t)
LoggerDEBUG level.
debug in interface Loggermarker - 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)
LoggerDEBUG level.
debug in interface Loggermarker - the marker data specific to this log statementmessage - the message object to log.
public void debug(Marker marker,
Object message,
Throwable t)
LoggerDEBUG level including the stack trace of the Throwable
t passed as parameter.
debug in interface Loggermarker - 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)
LoggerDEBUG level.
debug in interface Loggermarker - the marker data specific to this log statementmessage - the message object to log.
public void debug(Marker marker,
String message,
Object... params)
LoggerDEBUG level.
debug in interface Loggermarker - 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)
LoggerDEBUG level including the stack trace of the Throwable
t passed as parameter.
debug in interface Loggermarker - 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)
LoggerDEBUG level.
debug in interface Loggermsg - the message string to be logged
public void debug(Message msg,
Throwable t)
LoggerDEBUG level.
debug in interface Loggermsg - the message string to be loggedt - A Throwable or null.public void debug(Object message)
LoggerDEBUG level.
debug in interface Loggermessage - the message object to log.
public void debug(Object message,
Throwable t)
LoggerDEBUG level including the stack trace of the Throwable
t passed as parameter.
debug in interface Loggermessage - the message to log.t - the exception to log, including its stack trace.public void debug(String message)
LoggerDEBUG level.
debug in interface Loggermessage - the message object to log.
public void debug(String message,
Object... params)
LoggerDEBUG level.
debug in interface Loggermessage - 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)
LoggerDEBUG level including the stack trace of the Throwable
t passed as parameter.
debug in interface Loggermessage - the message to log.t - the exception to log, including its stack trace.public void entry()
Logger
entry in interface Loggerpublic 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 Loggerparams - 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)
LoggerERROR level.
error in interface Loggermarker - the marker data specific to this log statementmsg - the message string to be logged
public void error(Marker marker,
Message msg,
Throwable t)
LoggerERROR level.
error in interface Loggermarker - 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)
LoggerERROR level.
error in interface Loggermarker - the marker data specific to this log statement.message - the message object to log.
public void error(Marker marker,
Object message,
Throwable t)
LoggerERROR level including the stack trace of the Throwable
t passed as parameter.
error in interface Loggermarker - 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)
LoggerERROR level.
error in interface Loggermarker - the marker data specific to this log statement.message - the message object to log.
public void error(Marker marker,
String message,
Object... params)
LoggerERROR level.
error in interface Loggermarker - 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)
LoggerERROR level including the stack trace of the Throwable
t passed as parameter.
error in interface Loggermarker - 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)
LoggerERROR level.
error in interface Loggermsg - the message string to be logged
public void error(Message msg,
Throwable t)
LoggerERROR level.
error in interface Loggermsg - the message string to be loggedt - A Throwable or null.public void error(Object message)
LoggerERROR level.
error in interface Loggermessage - the message object to log.
public void error(Object message,
Throwable t)
LoggerERROR level including the stack trace of the Throwable
t passed as parameter.
error in interface Loggermessage - the message object to log.t - the exception to log, including its stack trace.public void error(String message)
LoggerERROR level.
error in interface Loggermessage - the message object to log.
public void error(String message,
Object... params)
LoggerERROR level.
error in interface Loggermessage - 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)
LoggerERROR level including the stack trace of the Throwable
t passed as parameter.
error in interface Loggermessage - the message object to log.t - the exception to log, including its stack trace.public void exit()
Logger
exit in interface Loggerpublic <R> R exit(R result)
Logger
return LOGGER.exit(myResult);
exit in interface LoggerR - 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)
LoggerFATAL level.
fatal in interface Loggermarker - the marker data specific to this log statementmsg - the message string to be logged
public void fatal(Marker marker,
Message msg,
Throwable t)
LoggerFATAL level.
fatal in interface Loggermarker - 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)
LoggerFATAL level.
fatal in interface Loggermarker - The marker data specific to this log statement.message - the message object to log.
public void fatal(Marker marker,
Object message,
Throwable t)
LoggerFATAL level including the stack trace of the Throwable
t passed as parameter.
fatal in interface Loggermarker - 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)
LoggerFATAL level.
fatal in interface Loggermarker - The marker data specific to this log statement.message - the message object to log.
public void fatal(Marker marker,
String message,
Object... params)
LoggerFATAL level.
fatal in interface Loggermarker - 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)
LoggerFATAL level including the stack trace of the Throwable
t passed as parameter.
fatal in interface Loggermarker - 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)
LoggerFATAL level.
fatal in interface Loggermsg - the message string to be logged
public void fatal(Message msg,
Throwable t)
LoggerFATAL level.
fatal in interface Loggermsg - the message string to be loggedt - A Throwable or null.public void fatal(Object message)
LoggerFATAL level.
fatal in interface Loggermessage - the message object to log.
public void fatal(Object message,
Throwable t)
LoggerFATAL level including the stack trace of the Throwable
t passed as parameter.
fatal in interface Loggermessage - the message object to log.t - the exception to log, including its stack trace.public void fatal(String message)
LoggerFATAL level.
fatal in interface Loggermessage - the message object to log.
public void fatal(String message,
Object... params)
LoggerFATAL level.
fatal in interface Loggermessage - 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)
LoggerFATAL level including the stack trace of the Throwable
t passed as parameter.
fatal in interface Loggermessage - the message object to log.t - the exception to log, including its stack trace.public MessageFactory getMessageFactory()
Logger
getMessageFactory in interface Loggerpublic String getName()
Logger
getName in interface Logger
public void info(Marker marker,
Message msg)
LoggerINFO level.
info in interface Loggermarker - the marker data specific to this log statementmsg - the message string to be logged
public void info(Marker marker,
Message msg,
Throwable t)
LoggerINFO level.
info in interface Loggermarker - 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)
LoggerINFO level.
info in interface Loggermarker - the marker data specific to this log statementmessage - the message object to log.
public void info(Marker marker,
Object message,
Throwable t)
LoggerINFO level including the stack trace of the Throwable
t passed as parameter.
info in interface Loggermarker - 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)
LoggerINFO level.
info in interface Loggermarker - the marker data specific to this log statementmessage - the message object to log.
public void info(Marker marker,
String message,
Object... params)
LoggerINFO level.
info in interface Loggermarker - 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)
LoggerINFO level including the stack trace of the Throwable
t passed as parameter.
info in interface Loggermarker - 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)
LoggerINFO level.
info in interface Loggermsg - the message string to be logged
public void info(Message msg,
Throwable t)
LoggerINFO level.
info in interface Loggermsg - the message string to be loggedt - A Throwable or null.public void info(Object message)
LoggerINFO level.
info in interface Loggermessage - the message object to log.
public void info(Object message,
Throwable t)
LoggerINFO level including the stack trace of the Throwable
t passed as parameter.
info in interface Loggermessage - the message object to log.t - the exception to log, including its stack trace.public void info(String message)
LoggerINFO level.
info in interface Loggermessage - the message object to log.
public void info(String message,
Object... params)
LoggerINFO level.
info in interface Loggermessage - 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)
LoggerINFO level including the stack trace of the Throwable
t passed as parameter.
info in interface Loggermessage - the message object to log.t - the exception to log, including its stack trace.public boolean isDebugEnabled()
LoggerDEBUG Level.
isDebugEnabled in interface Loggertrue if this Logger is enabled for level DEBUG, false otherwise.public boolean isDebugEnabled(Marker marker)
LoggerDEBUG Level.
isDebugEnabled in interface Loggermarker - 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 Loggerlevel - 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 Loggerlevel - 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()
LoggerERROR Level.
isErrorEnabled in interface Loggertrue if this Logger is enabled for level ERROR, false
otherwise.public boolean isErrorEnabled(Marker marker)
LoggerERROR Level.
isErrorEnabled in interface Loggermarker - The marker data specific to this log statement.
true if this Logger is enabled for level ERROR, false
otherwise.public boolean isFatalEnabled()
LoggerFATAL Level.
isFatalEnabled in interface Loggertrue if this Logger is enabled for level FATAL, false
otherwise.public boolean isFatalEnabled(Marker marker)
LoggerFATAL Level.
isFatalEnabled in interface Loggermarker - The marker data specific to this log statement.
true if this Logger is enabled for level FATAL, false
otherwise.public boolean isInfoEnabled()
LoggerINFO Level.
isInfoEnabled in interface Loggertrue if this Logger is enabled for level INFO, false otherwise.public boolean isInfoEnabled(Marker marker)
LoggerINFO Level.
isInfoEnabled in interface Loggermarker - The marker data specific to this log statement.
true if this Logger is enabled for level INFO, false otherwise.public boolean isTraceEnabled()
LoggerTRACE level.
isTraceEnabled in interface Loggertrue if this Logger is enabled for level TRACE, false otherwise.public boolean isTraceEnabled(Marker marker)
LoggerTRACE level.
isTraceEnabled in interface Loggermarker - The marker data specific to this log statement.
true if this Logger is enabled for level TRACE, false otherwise.public boolean isWarnEnabled()
LoggerWARN Level.
isWarnEnabled in interface Loggertrue if this Logger is enabled for level WARN, false
otherwise.public boolean isWarnEnabled(Marker marker)
LoggerWARN Level.
isWarnEnabled in interface Loggermarker - 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 Loggerlevel - the logging levelmarker - the marker data specific to this log statementmsg - the message string to be logged
public void log(Level level,
Marker marker,
Message msg,
Throwable t)
Logger
log in interface Loggerlevel - 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 Loggerlevel - 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)
LoggerThrowable t passed as
parameter.
log in interface Loggerlevel - 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 Loggerlevel - 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 Loggerlevel - 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)
LoggerThrowable t passed as
parameter.
log in interface Loggerlevel - 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 Loggerlevel - the logging levelmsg - the message string to be logged
public void log(Level level,
Message msg,
Throwable t)
Logger
log in interface Loggerlevel - the logging levelmsg - the message string to be loggedt - A Throwable or null.
public void log(Level level,
Object message)
Logger
log in interface Loggerlevel - the logging levelmessage - the message object to log.
public void log(Level level,
Object message,
Throwable t)
LoggerThrowable t passed as
parameter.
log in interface Loggerlevel - 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 Loggerlevel - the logging levelmessage - the message object to log.
public void log(Level level,
String message,
Object... params)
Logger
log in interface Loggerlevel - 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)
LoggerThrowable t passed as
parameter.
log in interface Loggerlevel - 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 ExtendedLoggerfqcn - 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 ExtendedLoggerfqcn - 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 ExtendedLoggerfqcn - 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 ExtendedLoggerfqcn - 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 ExtendedLoggerfqcn - 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 Loggerlevel - 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 Loggerlevel - 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 LoggerT - 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 LoggerT - 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)
LoggerTRACE level.
trace in interface Loggermarker - the marker data specific to this log statementmsg - the message string to be logged
public void trace(Marker marker,
Message msg,
Throwable t)
LoggerTRACE level.
trace in interface Loggermarker - 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)
LoggerTRACE level.
trace in interface Loggermarker - the marker data specific to this log statementmessage - the message object to log.
public void trace(Marker marker,
Object message,
Throwable t)
LoggerTRACE level including the stack trace of the Throwable
t passed as parameter.
trace in interface Loggermarker - 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)
LoggerTRACE level.
trace in interface Loggermarker - the marker data specific to this log statementmessage - the message object to log.
public void trace(Marker marker,
String message,
Object... params)
LoggerTRACE level.
trace in interface Loggermarker - 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)
LoggerTRACE level including the stack trace of the Throwable
t passed as parameter.
trace in interface Loggermarker - 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)
LoggerTRACE level.
trace in interface Loggermsg - the message string to be logged
public void trace(Message msg,
Throwable t)
LoggerTRACE level.
trace in interface Loggermsg - the message string to be loggedt - A Throwable or null.public void trace(Object message)
LoggerTRACE level.
trace in interface Loggermessage - the message object to log.
public void trace(Object message,
Throwable t)
LoggerTRACE level including the stack trace of the Throwable
t passed as parameter.
trace in interface Loggermessage - the message object to log.t - the exception to log, including its stack trace.Logger.debug(String)public void trace(String message)
LoggerTRACE level.
trace in interface Loggermessage - the message object to log.
public void trace(String message,
Object... params)
LoggerTRACE level.
trace in interface Loggermessage - 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)
LoggerTRACE level including the stack trace of the Throwable
t passed as parameter.
trace in interface Loggermessage - the message object to log.t - the exception to log, including its stack trace.Logger.debug(String)
public void warn(Marker marker,
Message msg)
LoggerWARN level.
warn in interface Loggermarker - the marker data specific to this log statementmsg - the message string to be logged
public void warn(Marker marker,
Message msg,
Throwable t)
LoggerWARN level.
warn in interface Loggermarker - 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)
LoggerWARN level.
warn in interface Loggermarker - the marker data specific to this log statementmessage - the message object to log.
public void warn(Marker marker,
Object message,
Throwable t)
LoggerWARN level including the stack trace of the Throwable
t passed as parameter.
warn in interface Loggermarker - 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)
LoggerWARN level.
warn in interface Loggermarker - the marker data specific to this log statementmessage - the message object to log.
public void warn(Marker marker,
String message,
Object... params)
LoggerWARN level.
warn in interface Loggermarker - 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)
LoggerWARN level including the stack trace of the Throwable
t passed as parameter.
warn in interface Loggermarker - 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)
LoggerWARN level.
warn in interface Loggermsg - the message string to be logged
public void warn(Message msg,
Throwable t)
LoggerWARN level.
warn in interface Loggermsg - the message string to be loggedt - A Throwable or null.public void warn(Object message)
LoggerWARN level.
warn in interface Loggermessage - the message object to log.
public void warn(Object message,
Throwable t)
LoggerWARN level including the stack trace of the Throwable
t passed as parameter.
warn in interface Loggermessage - the message object to log.t - the exception to log, including its stack trace.public void warn(String message)
LoggerWARN level.
warn in interface Loggermessage - the message object to log.
public void warn(String message,
Object... params)
LoggerWARN level.
warn in interface Loggermessage - 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)
LoggerWARN level including the stack trace of the Throwable
t passed as parameter.
warn in interface Loggermessage - 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.