Java Utililty Methods slf4j Logger

List of utility methods to do slf4j Logger

Description

The list of methods to do slf4j Logger are organized into topic(s).

Method

voidwarn(String message)
Prints given message in warn level by a logger
instance of caller class.
warn(getLoggerInstance(getCallerClassName()), message);
voidwarn(String msg)
warn
StackTraceElement se = Thread.currentThread().getStackTrace()[2];
String clazzMethod = " " + se.getClassName() + "." + se.getMethodName() + "(" + se.getFileName() + ":"
        + se.getLineNumber() + ") ";
String log = clazzMethod + "   " + " MSG: " + msg;
logger.warn(log);
voidwarn(String msg)
warn
logger.warn(msg);
voidwarnOrDebug(Logger logger, String msg)
warn Or Debug
warnOrDebug(logger, msg, null);
RunnablewrapWithMDC(Runnable r)
wrap With MDC
Map<String, String> mdc = MDC.getCopyOfContextMap();
return () -> {
    Map<String, String> oldMdc = MDC.getCopyOfContextMap();
    if (mdc == null) {
        MDC.clear();
    } else {
        MDC.setContextMap(mdc);
    try {
        r.run();
    } finally {
        if (oldMdc == null) {
            MDC.clear();
        } else {
            MDC.setContextMap(oldMdc);
};
voidwriteErrorLog(String cont)
write Error Log
GATELOG_ERROR.error(cont);