public class Log4j2LogAdapter extends Object implements Log
org.apache.logging.log4j.Logger
implementing our own
Log
interface.Constructor and Description |
---|
Log4j2LogAdapter(org.apache.logging.log4j.Logger logger)
Construct a Log4j Logger wrapper
|
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. |
public Log4j2LogAdapter(org.apache.logging.log4j.Logger logger)
logger
- the log4j Loggerpublic void debug(String message, Object... params)
public void debug(String message, Supplier<?>... paramSuppliers)
public void debug(String message, Throwable t)
Throwable
t
passed as parameter.public void error(String message, Object... params)
public void error(String message, Supplier<?>... paramSuppliers)
public void error(String message, Throwable t)
Throwable
t
passed as parameter.public void fatal(String message, Object... params)
public void fatal(String message, Supplier<?>... paramSuppliers)
public void fatal(String message, Throwable t)
Throwable
t
passed as parameter.public void info(String message, Object... params)
public void info(String message, Supplier<?>... paramSuppliers)
public void info(String message, Throwable t)
Throwable
t
passed as parameter.public boolean isDebugEnabled()
isDebugEnabled
in interface Log
true
if this Logger is enabled for level DEBUG, false
otherwise.public boolean isErrorEnabled()
isErrorEnabled
in interface Log
true
if this Logger is enabled for level ERROR, false
otherwise.public boolean isFatalEnabled()
isFatalEnabled
in interface Log
true
if this Logger is enabled for level FATAL, false
otherwise.public boolean isInfoEnabled()
isInfoEnabled
in interface Log
true
if this Logger is enabled for level INFO, false
otherwise.public boolean isTraceEnabled()
isTraceEnabled
in interface Log
true
if this Logger is enabled for level TRACE, false
otherwise.public boolean isWarnEnabled()
isWarnEnabled
in interface Log
true
if this Logger is enabled for level WARN, false
otherwise.public void trace(String message, Object... params)
public void trace(String message, Supplier<?>... paramSuppliers)
public void trace(String message, Throwable t)
Throwable
t
passed as parameter.trace
in interface Log
message
- the message object to log.t
- the exception to log, including its stack trace.debug(String)
public void warn(String message, Object... params)
public void warn(String message, Supplier<?>... paramSuppliers)
Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.