org.apache.logging.log4j.spi
Class AbstractLogger

java.lang.Object
  extended by org.apache.logging.log4j.spi.AbstractLogger
All Implemented Interfaces:
Logger
Direct Known Subclasses:
AbstractLoggerWrapper, SimpleLogger, StatusLogger

public abstract class AbstractLogger
extends Object
implements Logger

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 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 the class (or subclass).
AbstractLogger(String name)
          Creates a new named logger.
 
Method Summary
 void catching(Level level, Throwable t)
          Logs a Throwable that has been caught.
 void catching(Throwable t)
          Logs a Throwable at the ERROR level..
 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.
 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.
<R> R
exit(R result)
          Logs exiting from a method with the result.
 void fatal(Marker marker, Message msg)
          Logs a message with the specific Marker at the FATAL level.
 void fatal(Marker marker, Message msg, Throwable t)
          Logs a message with the specific Marker at the FATAL level.
 void fatal(Marker marker, Object message)
          Logs a message object with the FATAL level.
 void fatal(Marker marker, Object message, Throwable t)
          Logs a message at the FATAL level including the stack trace of the Throwable t passed as parameter.
 void fatal(Marker marker, String message)
          Logs a message object with the FATAL level.
 void fatal(Marker marker, String message, Object... params)
          Logs a message with parameters at the FATAL level.
 void fatal(Marker marker, String message, Throwable t)
          Logs a message at the FATAL level including the stack trace of the Throwable t passed as parameter.
 void fatal(Message msg)
          Logs a message with the specific Marker at the FATAL level.
 void fatal(Message msg, Throwable t)
          Logs a message with the specific Marker at the FATAL level.
 void fatal(Object message)
          Logs a message object with the FATAL level.
 void fatal(Object message, Throwable t)
          Logs a message at the FATAL level including the stack trace of the Throwable t passed as parameter.
 void fatal(String message)
          Logs a message object with the FATAL level.
 void fatal(String message, Object... params)
          Logs a message with parameters at the FATAL level.
 void fatal(String message, Throwable t)
          Logs a message at the FATAL level including the stack trace of the Throwable t passed as parameter.
 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 TRACE 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.
protected abstract  boolean isEnabled(Level level, Marker marker, Message data, Throwable t)
          Determine if logging is enabled.
protected abstract  boolean isEnabled(Level level, Marker marker, Object data, Throwable t)
          Determine if logging is enabled.
protected abstract  boolean isEnabled(Level level, Marker marker, String data)
          Determine if logging is enabled.
protected abstract  boolean isEnabled(Level level, Marker marker, String data, Object... p1)
          Determine if logging is enabled.
protected abstract  boolean isEnabled(Level level, Marker marker, String data, Throwable t)
          Determine if logging is enabled.
 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.
protected abstract  void log(Marker marker, String fqcn, Level level, Message data, Throwable t)
          Logs a message with location information.
<T extends Throwable>
T
throwing(Level level, T t)
          Logs a Throwable to be thrown.
<T extends Throwable>
T
throwing(T t)
          Logs a Throwable to be thrown.
 String toString()
          Returns a String representation of this instance in the form "name".
 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, wait, wait, wait
 

Field Detail

FLOW_MARKER

public static final Marker FLOW_MARKER
Marker for flow tracing.


ENTRY_MARKER

public static final Marker ENTRY_MARKER
Marker for method entry tracing.


EXIT_MARKER

public static final Marker EXIT_MARKER
Marker for method exit tracing.


EXCEPTION_MARKER

public static final Marker EXCEPTION_MARKER
Marker for exception tracing.


THROWING_MARKER

public static final Marker THROWING_MARKER
Marker for throwing exceptions.


CATCHING_MARKER

public static final Marker CATCHING_MARKER
Marker for catching exceptions.

Constructor Detail

AbstractLogger

public AbstractLogger()
Creates a new logger named after the class (or subclass).


AbstractLogger

public AbstractLogger(String name)
Creates a new named logger.

Parameters:
name - the logger name
Method Detail

entry

public void entry()
Logs entry to a method.

Specified by:
entry in interface Logger

entry

public void entry(Object... params)
Logs entry to a method.

Specified by:
entry in interface Logger
Parameters:
params - The parameters to the method.

exit

public void exit()
Logs exit from a method.

Specified by:
exit in interface Logger

exit

public <R> R exit(R result)
Logs exiting from a method with the result.

Specified by:
exit in interface Logger
Type Parameters:
R - The type of the parameter and object being returned.
Parameters:
result - The result being returned from the method call.
Returns:
the Throwable.

throwing

public <T extends Throwable> T throwing(T t)
Logs a Throwable to be thrown.

Specified by:
throwing in interface Logger
Type Parameters:
T - the type of the Throwable.
Parameters:
t - The Throwable.
Returns:
the Throwable.

throwing

public <T extends Throwable> T throwing(Level level,
                                        T t)
Logs a Throwable to be thrown.

Specified by:
throwing in interface Logger
Type Parameters:
T - the type of the Throwable.
Parameters:
level - The logging Level.
t - The Throwable.
Returns:
the Throwable.

catching

public void catching(Throwable t)
Logs a Throwable at the ERROR level..

Specified by:
catching in interface Logger
Parameters:
t - The Throwable.

catching

public void catching(Level level,
                     Throwable t)
Logs a Throwable that has been caught.

Specified by:
catching in interface Logger
Parameters:
level - The logging Level.
t - The Throwable.

trace

public void trace(String message)
Logs a message object with the TRACE level.

Specified by:
trace in interface Logger
Parameters:
message - the message object to log.

trace

public void trace(Marker marker,
                  String message)
Logs a message object with the TRACE level.

Specified by:
trace in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.

trace

public void trace(String message,
                  Throwable t)
Logs a message at the TRACE level including the stack trace of the Throwable t passed as parameter.

See debug(String) form for more detailed information.

Specified by:
trace in interface Logger
Parameters:
message - the message object to log.
t - the exception to log, including its stack trace.

trace

public 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.

See debug(String) form for more detailed information.

Specified by:
trace in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.
t - the exception to log, including its stack trace.

trace

public void trace(Object message)
Logs a message object with the TRACE level.

Specified by:
trace in interface Logger
Parameters:
message - the message object to log.

trace

public void trace(Marker marker,
                  Object message)
Logs a message object with the TRACE level.

Specified by:
trace in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.

trace

public void trace(Object message,
                  Throwable t)
Logs a message at the TRACE level including the stack trace of the Throwable t passed as parameter.

See debug(String) form for more detailed information.

Specified by:
trace in interface Logger
Parameters:
message - the message object to log.
t - the exception to log, including its stack trace.

trace

public 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.

See debug(String) form for more detailed information.

Specified by:
trace in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.
t - the exception to log, including its stack trace.

trace

public void trace(String message,
                  Object... params)
Logs a message with parameters at the TRACE level.

Specified by:
trace in interface Logger
Parameters:
message - the message to log.
params - parameters to the message.

trace

public void trace(Marker marker,
                  String message,
                  Object... params)
Logs a message with parameters at the TRACE level.

Specified by:
trace in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message to log.
params - parameters to the message.

isTraceEnabled

public boolean isTraceEnabled()
Checks whether this Logger is enabled for the TRACE Level.

Specified by:
isTraceEnabled in interface Logger
Returns:
boolean - true if this Logger is enabled for level TRACE, false otherwise.

isTraceEnabled

public boolean isTraceEnabled(Marker marker)
Checks whether this Logger is enabled for the TRACE Level.

Specified by:
isTraceEnabled in interface Logger
Parameters:
marker - The marker data.
Returns:
boolean - true if this Logger is enabled for level TRACE, false otherwise.

trace

public void trace(Message msg)
Logs a message with the specific Marker at the TRACE level.

Specified by:
trace in interface Logger
Parameters:
msg - the message string to be logged

trace

public void trace(Message msg,
                  Throwable t)
Logs a message with the specific Marker at the TRACE level.

Specified by:
trace in interface Logger
Parameters:
msg - the message string to be logged
t - A Throwable or null.

trace

public void trace(Marker marker,
                  Message msg)
Logs a message with the specific Marker at the TRACE level.

Specified by:
trace in interface Logger
Parameters:
marker - the marker data specific to this log statement.
msg - the message string to be logged

trace

public void trace(Marker marker,
                  Message msg,
                  Throwable t)
Logs a message with the specific Marker at the TRACE level.

Specified by:
trace in interface Logger
Parameters:
marker - the marker data specific to this log statement.
msg - the message string to be logged
t - A Throwable or null.

debug

public void debug(String message)
Logs a message object with the DEBUG level.

Specified by:
debug in interface Logger
Parameters:
message - the message object to log.

debug

public void debug(Marker marker,
                  String message)
Logs a message object with the DEBUG level.

Specified by:
debug in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.

debug

public void debug(String message,
                  Throwable t)
Logs a message at the DEBUG level including the stack trace of the Throwable t passed as parameter.

Specified by:
debug in interface Logger
Parameters:
message - the message to log.
t - the exception to log, including its stack trace.

debug

public 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.

Specified by:
debug in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message to log.
t - the exception to log, including its stack trace.

debug

public void debug(Object message)
Logs a message object with the DEBUG level.

Specified by:
debug in interface Logger
Parameters:
message - the message object to log.

debug

public void debug(Marker marker,
                  Object message)
Logs a message object with the DEBUG level.

Specified by:
debug in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.

debug

public void debug(Object message,
                  Throwable t)
Logs a message at the DEBUG level including the stack trace of the Throwable t passed as parameter.

Specified by:
debug in interface Logger
Parameters:
message - the message to log.
t - the exception to log, including its stack trace.

debug

public 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.

Specified by:
debug in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message to log.
t - the exception to log, including its stack trace.

debug

public void debug(String message,
                  Object... params)
Logs a message with parameters at the DEBUG level.

Specified by:
debug in interface Logger
Parameters:
message - the message to log.
params - parameters to the message.

debug

public void debug(Marker marker,
                  String message,
                  Object... params)
Logs a message with parameters at the DEBUG level.

Specified by:
debug in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message to log.
params - parameters to the message.

isDebugEnabled

public boolean isDebugEnabled()
Checks whether this Logger is enabled for the DEBUG Level.

Specified by:
isDebugEnabled in interface Logger
Returns:
boolean - true if this Logger is enabled for level DEBUG, false otherwise.

isDebugEnabled

public boolean isDebugEnabled(Marker marker)
Checks whether this Logger is enabled for the DEBUG Level.

Specified by:
isDebugEnabled in interface Logger
Parameters:
marker - The marker data.
Returns:
boolean - true if this Logger is enabled for level DEBUG, false otherwise.

debug

public void debug(Message msg)
Logs a message with the specific Marker at the DEBUG level.

Specified by:
debug in interface Logger
Parameters:
msg - the message string to be logged

debug

public void debug(Message msg,
                  Throwable t)
Logs a message with the specific Marker at the DEBUG level.

Specified by:
debug in interface Logger
Parameters:
msg - the message string to be logged
t - A Throwable or null.

debug

public void debug(Marker marker,
                  Message msg)
Logs a message with the specific Marker at the DEBUG level.

Specified by:
debug in interface Logger
Parameters:
marker - the marker data specific to this log statement
msg - the message string to be logged

debug

public void debug(Marker marker,
                  Message msg,
                  Throwable t)
Logs a message with the specific Marker at the DEBUG level.

Specified by:
debug in interface Logger
Parameters:
marker - the marker data specific to this log statement.
msg - the message string to be logged
t - A Throwable or null.

info

public void info(String message)
Logs a message object with the INFO level.

Specified by:
info in interface Logger
Parameters:
message - the message object to log.

info

public void info(Marker marker,
                 String message)
Logs a message object with the INFO level.

Specified by:
info in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.

info

public void info(String message,
                 Throwable t)
Logs a message at the INFO level including the stack trace of the Throwable t passed as parameter.

Specified by:
info in interface Logger
Parameters:
message - the message object to log.
t - the exception to log, including its stack trace.

info

public 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.

Specified by:
info in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.
t - the exception to log, including its stack trace.

info

public void info(Object message)
Logs a message object with the INFO level.

Specified by:
info in interface Logger
Parameters:
message - the message object to log.

info

public void info(Marker marker,
                 Object message)
Logs a message object with the INFO level.

Specified by:
info in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.

info

public void info(Object message,
                 Throwable t)
Logs a message at the INFO level including the stack trace of the Throwable t passed as parameter.

Specified by:
info in interface Logger
Parameters:
message - the message object to log.
t - the exception to log, including its stack trace.

info

public 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.

Specified by:
info in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.
t - the exception to log, including its stack trace.

info

public void info(String message,
                 Object... params)
Logs a message with parameters at the INFO level.

Specified by:
info in interface Logger
Parameters:
message - the message to log.
params - parameters to the message.

info

public void info(Marker marker,
                 String message,
                 Object... params)
Logs a message with parameters at the INFO level.

Specified by:
info in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message to log.
params - parameters to the message.

isInfoEnabled

public boolean isInfoEnabled()
Checks whether this Logger is enabled for the INFO Level.

Specified by:
isInfoEnabled in interface Logger
Returns:
boolean - true if this Logger is enabled for level INFO, false otherwise.

isInfoEnabled

public boolean isInfoEnabled(Marker marker)
Checks whether this Logger is enabled for the INFO Level.

Specified by:
isInfoEnabled in interface Logger
Parameters:
marker - The marker data.
Returns:
boolean - true if this Logger is enabled for level INFO, false otherwise.

info

public void info(Message msg)
Logs a message with the specific Marker at the TRACE level.

Specified by:
info in interface Logger
Parameters:
msg - the message string to be logged

info

public void info(Message msg,
                 Throwable t)
Logs a message with the specific Marker at the INFO level.

Specified by:
info in interface Logger
Parameters:
msg - the message string to be logged
t - A Throwable or null.

info

public void info(Marker marker,
                 Message msg)
Logs a message with the specific Marker at the INFO level.

Specified by:
info in interface Logger
Parameters:
marker - the marker data specific to this log statement
msg - the message string to be logged

info

public void info(Marker marker,
                 Message msg,
                 Throwable t)
Logs a message with the specific Marker at the INFO level.

Specified by:
info in interface Logger
Parameters:
marker - the marker data specific to this log statement
msg - the message string to be logged
t - A Throwable or null.

warn

public void warn(String message)
Logs a message object with the WARN level.

Specified by:
warn in interface Logger
Parameters:
message - the message object to log.

warn

public void warn(Marker marker,
                 String message)
Logs a message object with the WARN level.

Specified by:
warn in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.

warn

public void warn(String message,
                 Throwable t)
Logs a message at the WARN level including the stack trace of the Throwable t passed as parameter.

Specified by:
warn in interface Logger
Parameters:
message - the message object to log.
t - the exception to log, including its stack trace.

warn

public 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.

Specified by:
warn in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.
t - the exception to log, including its stack trace.

warn

public void warn(Marker marker,
                 Object message)
Logs a message object with the WARN level.

Specified by:
warn in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.

warn

public void warn(Object message)
Logs a message object with the WARN level.

Specified by:
warn in interface Logger
Parameters:
message - the message object to log.

warn

public void warn(Object message,
                 Throwable t)
Logs a message at the WARN level including the stack trace of the Throwable t passed as parameter.

Specified by:
warn in interface Logger
Parameters:
message - the message object to log.
t - the exception to log, including its stack trace.

warn

public 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.

Specified by:
warn in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.
t - the exception to log, including its stack trace.

warn

public void warn(String message,
                 Object... params)
Logs a message with parameters at the WARN level.

Specified by:
warn in interface Logger
Parameters:
message - the message to log.
params - parameters to the message.

warn

public void warn(Marker marker,
                 String message,
                 Object... params)
Logs a message with parameters at the WARN level.

Specified by:
warn in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message to log.
params - parameters to the message.

isWarnEnabled

public boolean isWarnEnabled()
Checks whether this Logger is enabled for the WARN Level.

Specified by:
isWarnEnabled in interface Logger
Returns:
boolean - true if this Logger is enabled for level WARN, false otherwise.

isWarnEnabled

public boolean isWarnEnabled(Marker marker)
Checks whether this Logger is enabled for the WARN Level.

Specified by:
isWarnEnabled in interface Logger
Parameters:
marker - The marker data.
Returns:
boolean - true if this Logger is enabled for level WARN, false otherwise.

warn

public void warn(Message msg)
Logs a message with the specific Marker at the WARN level.

Specified by:
warn in interface Logger
Parameters:
msg - the message string to be logged

warn

public void warn(Message msg,
                 Throwable t)
Logs a message with the specific Marker at the WARN level.

Specified by:
warn in interface Logger
Parameters:
msg - the message string to be logged
t - A Throwable or null.

warn

public void warn(Marker marker,
                 Message msg)
Logs a message with the specific Marker at the WARN level.

Specified by:
warn in interface Logger
Parameters:
marker - the marker data specific to this log statement
msg - the message string to be logged

warn

public void warn(Marker marker,
                 Message msg,
                 Throwable t)
Logs a message with the specific Marker at the WARN level.

Specified by:
warn in interface Logger
Parameters:
marker - the marker data specific to this log statement
msg - the message string to be logged
t - A Throwable or null.

error

public void error(String message)
Logs a message object with the ERROR level.

Specified by:
error in interface Logger
Parameters:
message - the message object to log.

error

public void error(Marker marker,
                  String message)
Logs a message object with the ERROR level.

Specified by:
error in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.

error

public void error(String message,
                  Throwable t)
Logs a message at the ERROR level including the stack trace of the Throwable t passed as parameter.

Specified by:
error in interface Logger
Parameters:
message - the message object to log.
t - the exception to log, including its stack trace.

error

public 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.

Specified by:
error in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.
t - the exception to log, including its stack trace.

error

public void error(Object message)
Logs a message object with the ERROR level.

Specified by:
error in interface Logger
Parameters:
message - the message object to log.

error

public void error(Marker marker,
                  Object message)
Logs a message object with the ERROR level.

Specified by:
error in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.

error

public void error(Object message,
                  Throwable t)
Logs a message at the ERROR level including the stack trace of the Throwable t passed as parameter.

Specified by:
error in interface Logger
Parameters:
message - the message object to log.
t - the exception to log, including its stack trace.

error

public 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.

Specified by:
error in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.
t - the exception to log, including its stack trace.

error

public void error(String message,
                  Object... params)
Logs a message with parameters at the ERROR level.

Specified by:
error in interface Logger
Parameters:
message - the message to log.
params - parameters to the message.

error

public void error(Marker marker,
                  String message,
                  Object... params)
Logs a message with parameters at the ERROR level.

Specified by:
error in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message to log.
params - parameters to the message.

isErrorEnabled

public boolean isErrorEnabled()
Checks whether this Logger is enabled for the ERROR Level.

Specified by:
isErrorEnabled in interface Logger
Returns:
boolean - true if this Logger is enabled for level ERROR, false otherwise.

isErrorEnabled

public boolean isErrorEnabled(Marker marker)
Checks whether this Logger is enabled for the ERROR Level.

Specified by:
isErrorEnabled in interface Logger
Parameters:
marker - The marker data.
Returns:
boolean - true if this Logger is enabled for level ERROR, false otherwise.

error

public void error(Message msg)
Logs a message with the specific Marker at the ERROR level.

Specified by:
error in interface Logger
Parameters:
msg - the message string to be logged

error

public void error(Message msg,
                  Throwable t)
Logs a message with the specific Marker at the ERROR level.

Specified by:
error in interface Logger
Parameters:
msg - the message string to be logged
t - A Throwable or null.

error

public void error(Marker marker,
                  Message msg)
Logs a message with the specific Marker at the ERROR level.

Specified by:
error in interface Logger
Parameters:
marker - the marker data specific to this log statement
msg - the message string to be logged

error

public void error(Marker marker,
                  Message msg,
                  Throwable t)
Logs a message with the specific Marker at the ERROR level.

Specified by:
error in interface Logger
Parameters:
marker - the marker data specific to this log statement
msg - the message string to be logged
t - A Throwable or null.

fatal

public void fatal(String message)
Logs a message object with the FATAL level.

Specified by:
fatal in interface Logger
Parameters:
message - the message object to log.

fatal

public void fatal(Marker marker,
                  String message)
Logs a message object with the FATAL level.

Specified by:
fatal in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.

fatal

public void fatal(String message,
                  Throwable t)
Logs a message at the FATAL level including the stack trace of the Throwable t passed as parameter.

Specified by:
fatal in interface Logger
Parameters:
message - the message object to log.
t - the exception to log, including its stack trace.

fatal

public 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.

Specified by:
fatal in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.
t - the exception to log, including its stack trace.

fatal

public void fatal(Object message)
Logs a message object with the FATAL level.

Specified by:
fatal in interface Logger
Parameters:
message - the message object to log.

fatal

public void fatal(Marker marker,
                  Object message)
Logs a message object with the FATAL level.

Specified by:
fatal in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.

fatal

public void fatal(Object message,
                  Throwable t)
Logs a message at the FATAL level including the stack trace of the Throwable t passed as parameter.

Specified by:
fatal in interface Logger
Parameters:
message - the message object to log.
t - the exception to log, including its stack trace.

fatal

public 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.

Specified by:
fatal in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message object to log.
t - the exception to log, including its stack trace.

fatal

public void fatal(String message,
                  Object... params)
Logs a message with parameters at the FATAL level.

Specified by:
fatal in interface Logger
Parameters:
message - the message to log.
params - parameters to the message.

fatal

public void fatal(Marker marker,
                  String message,
                  Object... params)
Logs a message with parameters at the FATAL level.

Specified by:
fatal in interface Logger
Parameters:
marker - the marker data specific to this log statement.
message - the message to log.
params - parameters to the message.

isFatalEnabled

public boolean isFatalEnabled()
Checks whether this Logger is enabled for the FATAL Level.

Specified by:
isFatalEnabled in interface Logger
Returns:
boolean - true if this Logger is enabled for level FATAL, false otherwise.

isFatalEnabled

public boolean isFatalEnabled(Marker marker)
Checks whether this Logger is enabled for the FATAL Level.

Specified by:
isFatalEnabled in interface Logger
Parameters:
marker - The marker data.
Returns:
boolean - true if this Logger is enabled for level FATAL, false otherwise.

fatal

public void fatal(Message msg)
Logs a message with the specific Marker at the FATAL level.

Specified by:
fatal in interface Logger
Parameters:
msg - the message string to be logged

fatal

public void fatal(Message msg,
                  Throwable t)
Logs a message with the specific Marker at the FATAL level.

Specified by:
fatal in interface Logger
Parameters:
msg - the message string to be logged
t - A Throwable or null.

fatal

public void fatal(Marker marker,
                  Message msg)
Logs a message with the specific Marker at the FATAL level.

Specified by:
fatal in interface Logger
Parameters:
marker - the marker data specific to this log statement
msg - the message string to be logged

fatal

public void fatal(Marker marker,
                  Message msg,
                  Throwable t)
Logs a message with the specific Marker at the FATAL level.

Specified by:
fatal in interface Logger
Parameters:
marker - the marker data specific to this log statement
msg - the message string to be logged
t - A Throwable or null.

log

protected abstract void log(Marker marker,
                            String fqcn,
                            Level level,
                            Message data,
                            Throwable t)
Logs a message with location information.

Parameters:
marker - The Marker
fqcn - The fully qualified class name of the caller
level - The logging level
data - The Message.
t - A Throwable or null.

isEnabled

protected abstract boolean isEnabled(Level level,
                                     Marker marker,
                                     String data)
Determine if logging is enabled.

Parameters:
level - The logging Level to check.
marker - A Marker or null.
data - The message.
Returns:
True if logging is enabled, false otherwise.

isEnabled

protected abstract boolean isEnabled(Level level,
                                     Marker marker,
                                     String data,
                                     Throwable t)
Determine if logging is enabled.

Parameters:
level - The logging Level to check.
marker - A Marker or null.
data - The message.
t - A Throwable.
Returns:
True if logging is enabled, false otherwise.

isEnabled

protected abstract boolean isEnabled(Level level,
                                     Marker marker,
                                     String data,
                                     Object... p1)
Determine if logging is enabled.

Parameters:
level - The logging Level to check.
marker - A Marker or null.
data - The message.
p1 - The parameters.
Returns:
True if logging is enabled, false otherwise.

isEnabled

protected abstract boolean isEnabled(Level level,
                                     Marker marker,
                                     Object data,
                                     Throwable t)
Determine if logging is enabled.

Parameters:
level - The logging Level to check.
marker - A Marker or null.
data - The message.
t - A Throwable.
Returns:
True if logging is enabled, false otherwise.

isEnabled

public boolean isEnabled(Level level)
Checks whether this Logger is enabled for the the given Level.

Note that passing in OFF always returns true.

Specified by:
isEnabled in interface Logger
Parameters:
level - the level to check
Returns:
boolean - true if this Logger is enabled for level, false otherwise.

isEnabled

protected abstract boolean isEnabled(Level level,
                                     Marker marker,
                                     Message data,
                                     Throwable t)
Determine if logging is enabled.

Parameters:
level - The logging Level to check.
marker - A Marker or null.
data - The Message.
t - A Throwable.
Returns:
True if logging is enabled, false otherwise.

getName

public String getName()
Description copied from interface: Logger
Gets the logger name.

Specified by:
getName in interface Logger
Returns:
the logger name.

toString

public String toString()
Returns a String representation of this instance in the form "name".

Overrides:
toString in class Object
Returns:
A String describing this Logger instance.


Copyright © 1999-2012 Apache Software Foundation. All Rights Reserved. Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, and the Apache Logging project logo are trademarks of The Apache Software Foundation.