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

LoggergetClassLogger()
Returns a logger for the calling class or context.
StackTraceElement[] stacktrace = Thread.currentThread().getStackTrace();
StackTraceElement element = stacktrace[2];
String name = element.getClassName();
return LoggerFactory.getLogger(name);
StringgetErrorMsg(String format, Object[] argArray)
get Error Msg
FormattingTuple ft = MessageFormatter.arrayFormat(format, argArray);
return ft.getMessage();
intgetIntValue(String strVal, int defVal)
get Int Value
try {
    return Integer.parseInt(strVal);
} catch (Exception exp) {
    log.error("Invalid int value : " + strVal);
return defVal;
LoggergetLog(Class clazz)
get Log
return LoggerFactory.getLogger(getLogCategory(clazz));
LoggergetLogger()
get Logger
return logger;
LoggergetLogger()
get Logger
Logger logger = currentLoggerMap.get();
if (null == logger) {
    return defaultLogger;
} else {
    return logger;
LoggergetLogger()
get Logger
final Throwable t = new Throwable();
t.fillInStackTrace();
final String clazz = t.getStackTrace()[1].getClassName();
return LoggerFactory.getLogger(clazz);
LoggergetLogger(Class clazz)
Gets the logger from the servicelocator
return LoggerFactory.getLogger(clazz);
LoggergetLogger(Class clazz)
get Logger
Logger ret = loggerCache.get(clazz);
if (ret == null) {
    ret = LoggerFactory.getLogger(clazz);
    loggerCache.put(clazz, ret);
return ret;
LoggergetLogger(Class clazz)
get Logger
return LoggerFactory.getLogger(clazz);