Class LogUtils
java.lang.Object
fr.opensagres.xdocreport.core.logging.LogUtils
A container for static utility methods related to logging.
Inspired from org.apache.cxf.common.logging.LogUtils
- Author:
- pascalleclercq
-
Method Summary
Modifier and TypeMethodDescriptionprotected static LoggercreateLogger(String loggerName) Create a loggerstatic LoggerGet a Logger with the associated default resource bundle for the class.static Loggerstatic voidChecks log level and logsstatic voidChecks log level and logsstatic voidChecks log level and logsstatic voidChecks log level and logsstatic voidAllows both parameter substitution and a typed Throwable to be logged.static voidAllows both parameter substitution and a typed Throwable to be logged.
-
Method Details
-
getLogger
Get a Logger with the associated default resource bundle for the class.- Parameters:
cls- the Class to contain the Logger- Returns:
- an appropriate Logger
-
createLogger
Create a logger -
log
public static void log(Logger logger, Level level, String message, Throwable throwable, Object parameter) Allows both parameter substitution and a typed Throwable to be logged.- Parameters:
logger- the Logger the log tolevel- the severity levelmessage- the log messagethrowable- the Throwable to logparameter- the parameter to substitute into message
-
log
public static void log(Logger logger, Level level, String message, Throwable throwable, Object... parameters) Allows both parameter substitution and a typed Throwable to be logged.- Parameters:
logger- the Logger the log tolevel- the severity levelmessage- the log messagethrowable- the Throwable to logparameters- the parameters to substitute into message
-
log
Checks log level and logs- Parameters:
logger- the Logger the log tolevel- the severity levelmessage- the log message
-
log
Checks log level and logs- Parameters:
logger- the Logger the log tolevel- the severity levelmessage- the log messagethrowable- the Throwable to log
-
log
Checks log level and logs- Parameters:
logger- the Logger the log tolevel- the severity levelmessage- the log messageparameter- the parameter to substitute into message
-
log
Checks log level and logs- Parameters:
logger- the Logger the log tolevel- the severity levelmessage- the log messageparameters- the parameters to substitute into message
-
getLogger
-