public final class AppLogService extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
debug(Object objToLog)
Log a message object with the DEBUG level.
|
static void |
debug(String message,
Object... params)
Logs a message with parameters at the
DEBUG level. |
static void |
debug(String message,
org.apache.logging.log4j.util.Supplier<?>... paramSuppliers)
Logs a message with parameters which are only to be constructed if the logging level is the
DEBUG level. |
static void |
error(Object objToLog)
Log a message object with the ERROR Level.
|
static void |
error(Object message,
Throwable t)
Log a message object with the ERROR level including the stack trace of the Throwable t passed as parameter.
|
static void |
error(String message,
Object... params)
Logs a message with parameters at the
ERROR level. |
static void |
error(String message,
org.apache.logging.log4j.util.Supplier<?>... paramSuppliers)
Logs a message with parameters which are only to be constructed if the logging level is the
ERROR level. |
static Collection<LoggerInfo> |
getLoggersInfo()
Gets the all the loggers.
|
static void |
info(Object objToLog)
Log a message object with the INFO Level in application.log
|
static void |
info(String message,
Object... params)
Logs a message with parameters at the
INFO level. |
static void |
info(String message,
org.apache.logging.log4j.util.Supplier<?>... paramSuppliers)
Logs a message with parameters which are only to be constructed if the logging level is the
INFO level. |
static boolean |
isDebugEnabled()
Tells if the logger accepts debug messages.
|
static boolean |
isDebugEnabled(String strLogger)
Tells if the logger accepts debug messages.
|
static boolean |
isErrorEnabled()
Tells if the logger accepts error messages.
|
static boolean |
isInfoEnabled()
Tells if the logger accepts info messages.
|
public static boolean isDebugEnabled()
public static void debug(Object objToLog)
objToLog - the message object to logpublic static void debug(String message, Object... params)
DEBUG level.
To improve performance, do not use String concatenation such as : AppLogService.error( "my message with param1 " + param1 + " and " + param2, myexception
); Recommended use : AppLogService.error( "my message with param1 {} and param2 {}", param1, param2, myexception );message - the message to log; the format depends on the message factory.params - parameters to the message.Logger##getMessageFactory()public static void debug(String message, org.apache.logging.log4j.util.Supplier<?>... paramSuppliers)
DEBUG level.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.public static boolean isDebugEnabled(String strLogger)
strLogger - The Logger namepublic static void error(Object objToLog)
objToLog - the message object to logpublic static void error(Object message, Throwable t)
message - the message object to logt - the exception to log, including its stack tracepublic static void error(String message, Object... params)
ERROR level.
To improve performance, do not use String concatenation such as : AppLogService.error( "my message with param1 " + param1 + " and " + param2,
myexception); Recommended use : AppLogService.error( "my message with param1 {} and param2 {}", param1, param2, myexception );message - the message to log; the format depends on the message factory.params - parameters to the message.Logger.getMessageFactory()public static void error(String message, org.apache.logging.log4j.util.Supplier<?>... paramSuppliers)
ERROR level.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.public static boolean isErrorEnabled()
public static void info(Object objToLog)
objToLog - the message object to logpublic static void info(String message, Object... params)
INFO level.
To improve performance, do not use String concatenation such as : AppLogService.error( "my message with param1 " + param1 + " and " + param2, myexception
); Recommended use : AppLogService.error( "my message with param1 {} and param2 {}", param1, param2, myexception );message - the message to log; the format depends on the message factory.params - parameters to the message.Logger##getMessageFactory()public static void info(String message, org.apache.logging.log4j.util.Supplier<?>... paramSuppliers)
INFO level.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.public static boolean isInfoEnabled()
public static Collection<LoggerInfo> getLoggersInfo()
Copyright © 2023 City of Paris. All rights reserved.