Modifier and Type | Field and Description |
---|---|
static org.apache.logging.log4j.Logger |
genericLogger
Generic logger.
|
Modifier and Type | Method and Description |
---|---|
static void |
log(org.apache.logging.log4j.Logger logger,
org.apache.logging.log4j.Level level,
String message)
Logs the supplied message.
|
static void |
log(org.apache.logging.log4j.Logger logger,
org.apache.logging.log4j.Level level,
String message,
Object... parameters)
Logs the supplied message as a formatted message with parameters.
|
public static final org.apache.logging.log4j.Logger genericLogger
public static void log(org.apache.logging.log4j.Logger logger, org.apache.logging.log4j.Level level, String message)
if (LOGGER.isEnabled(Level.DEBUG)) {
LOGGER.debug("The message");
}
to using: LogUtil.log(log, Level.DEBUG, "The message");logger
- The logger to log the supplied message to.
level
- The log level.
message
- The message to log.public static void log(org.apache.logging.log4j.Logger logger, org.apache.logging.log4j.Level level, String message, Object... parameters)
if (LOGGER.isEnabled(Level.DEBUG)) {
LOGGER.debug("The message", "param1", "param2");
}
to using: LogUtil.log(log, Level.DEBUG, "The message", "param1", "param2")LOGGER.info(() -> timeConsumingMethod());
logger
- The logger to log the supplied message to.
level
- The log level.
message
- The message to log.parameters
- Parameters to the message.Copyright © 2008–2018. All rights reserved.