public interface Log
The canonical way to obtain a Logger for a class is through LogManager.getLog(String)
}.
Typically, each class should get its own Log named after its fully qualified class name
public class MyClass { private static final Log log = LogManager.getLog(MyClass.class); // ... }
Modifier and Type | Method and Description |
---|---|
void |
debug(Object message)
Logs a message object with the DEBUG level.
|
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,
Supplier<?>... paramSuppliers)
Logs a message with parameters which are only to be constructed if the
logging level is 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 |
error(Object message)
Logs a message object with the ERROR level.
|
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,
Supplier<?>... paramSuppliers)
Logs a message with parameters which are only to be constructed if the
logging level is 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 |
fatal(Object message)
Logs a message object with the FATAL level.
|
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,
Supplier<?>... paramSuppliers)
Logs a message with parameters which are only to be constructed if the
logging level is 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(Object message)
Logs a message object with the INFO level.
|
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,
Supplier<?>... paramSuppliers)
Logs a message with parameters which are only to be constructed if the
logging level is 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 |
isErrorEnabled()
Checks whether this Logger is enabled for the ERROR Level.
|
boolean |
isFatalEnabled()
Checks whether this Logger is enabled for the FATAL Level.
|
boolean |
isInfoEnabled()
Checks whether this Logger is enabled for the INFO Level.
|
boolean |
isTraceEnabled()
Checks whether this Logger is enabled for the TRACE level.
|
boolean |
isWarnEnabled()
Checks whether this Logger is enabled for the WARN Level.
|
void |
trace(Object message)
Logs a message object with the TRACE level.
|
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,
Supplier<?>... paramSuppliers)
Logs a message with parameters which are only to be constructed if the
logging level is 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(Object message)
Logs a message object with the WARN level.
|
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,
Supplier<?>... paramSuppliers)
Logs a message with parameters which are only to be constructed if the
logging level is 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. |
void debug(String message)
message
- the message string to log.void debug(Object message)
message
- the message object to log.void debug(String message, Object... params)
message
- the message to log; the format depends on the message factory.params
- parameters to the message.void debug(String message, Supplier<?>... paramSuppliers)
message
- the message to log; the format depends on the message factory.paramSuppliers
- An array of functions, which when called, produce
the desired log message parameters.void debug(String message, Throwable t)
Throwable
t
passed as parameter.message
- the message to log.t
- the exception to log, including its stack trace.void error(String message)
message
- the message string to log.void error(Object message)
message
- the message object to log.void error(String message, Object... params)
message
- the message to log; the format depends on the message factory.params
- parameters to the message.void error(String message, Supplier<?>... paramSuppliers)
message
- the message to log; the format depends on the message factory.paramSuppliers
- An array of functions, which when called, produce
the desired log message parameters.void error(String message, Throwable t)
Throwable
t
passed as parameter.message
- the message object to log.t
- the exception to log, including its stack trace.void fatal(String message)
message
- the message string to log.void fatal(Object message)
message
- the message object to log.void fatal(String message, Object... params)
message
- the message to log; the format depends on the message factory.params
- parameters to the message.void fatal(String message, Supplier<?>... paramSuppliers)
message
- the message to log; the format depends on the message factory.paramSuppliers
- An array of functions, which when called, produce
the desired log message parameters.void fatal(String message, Throwable t)
Throwable
t
passed as parameter.message
- the message object to log.t
- the exception to log, including its stack trace.void info(String message)
message
- the message string to log.void info(Object message)
message
- the message object to log.void info(String message, Object... params)
message
- the message to log; the format depends on the message factory.params
- parameters to the message.void info(String message, Supplier<?>... paramSuppliers)
message
- the message to log; the format depends on the message factory.paramSuppliers
- An array of functions, which when called, produce
the desired log message parameters.void info(String message, Throwable t)
Throwable
t
passed as parameter.message
- the message object to log.t
- the exception to log, including its stack trace.boolean isDebugEnabled()
true
if this Logger is enabled for level DEBUG, false
otherwise.boolean isErrorEnabled()
true
if this Logger is enabled for level ERROR, false
otherwise.boolean isFatalEnabled()
true
if this Logger is enabled for level FATAL, false
otherwise.boolean isInfoEnabled()
true
if this Logger is enabled for level INFO, false
otherwise.boolean isTraceEnabled()
true
if this Logger is enabled for level TRACE, false
otherwise.boolean isWarnEnabled()
true
if this Logger is enabled for level WARN, false
otherwise.void trace(String message)
message
- the message string to log.void trace(Object message)
message
- the message object to log.void trace(String message, Object... params)
message
- the message to log; the format depends on the message factory.params
- parameters to the message.void trace(String message, Supplier<?>... paramSuppliers)
message
- the message to log; the format depends on the message factory.paramSuppliers
- An array of functions, which when called, produce
the desired log message parameters.void trace(String message, Throwable t)
Throwable
t
passed as parameter.message
- the message object to log.t
- the exception to log, including its stack trace.debug(String)
void warn(String message)
message
- the message string to log.void warn(Object message)
message
- the message object to log.void warn(String message, Object... params)
message
- the message to log; the format depends on the message factory.params
- parameters to the message.void warn(String message, Supplier<?>... paramSuppliers)
message
- the message to log; the format depends on the message factory.paramSuppliers
- An array of functions, which when called, produce
the desired log message parameters.Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.