List of utility methods to do slf4j Logger
void | logInfo(Logger log) Writes the logo to the given Logger , using the Info log level.
for (String line : lines) {
log.info(line);
|
void | logInfo(Logger log, Throwable t) log Info log.info(t.getMessage());
if (log.isDebugEnabled())
log.info(t.getMessage(), t);
|
void | logInfo(Logger logger, String s) log Info logger.info("[INFO] " + s);
|
void | logJavaProperties(Logger log) log Java Properties Properties javaProperties = System.getProperties(); SortedMap<String, String> sortedProperties = new TreeMap<String, String>(); for (String key : javaProperties.stringPropertyNames()) { sortedProperties.put(key, javaProperties.getProperty(key)); log.debug("Java properties (ordered by property name):"); for (String key : sortedProperties.keySet()) { log.debug(" {}={}", key, sortedProperties.get(key)); ... |
void | logLine(final Logger logger, final Level level, final String msg, final boolean withStackTrace, final String logMessagePrefix) Directly log msg to desired Logger . final String finalMsg = logMessagePrefix + msg; if (level == Level.INFO) { if (withStackTrace) { logger.info(finalMsg, new Throwable()); } else { logger.info(finalMsg); } else if (level == Level.SEVERE) { ... |
void | logResult(long time, String traceId, String apiName, String params, String jsonObject) log Result if (REUEST_LOGGER.isDebugEnabled()) { REUEST_LOGGER.debug(LOG_TRACE_MSG_WITH_PARAMS_DEBUG, new Object[] { time, traceId, apiName, params, jsonObject }); } else if (REUEST_LOGGER.isInfoEnabled()) { REUEST_LOGGER.info(LOG_TRACE_MSG_WITH_PARAMS_INFO, new Object[] { time, traceId, apiName }); |
void | logThreadGroup(final Logger log, ThreadGroup group, int level) This method recursively visits (LOG.info()) all thread groups under `group'. int numThreads = group.activeCount(); final Thread[] threads = new Thread[numThreads * 2]; numThreads = group.enumerate(threads, false); for (int i = 0; i < numThreads; i++) { final Thread thread = threads[i]; log.info(thread.toString()); int numGroups = group.activeGroupCount(); ... |
void | logThrowable(Throwable throwable) log Throwable logger.error("An exception occured:" + throwable.getMessage(), throwable);
|
void | logWarningWithDebugDetails(Logger logger, Throwable t, String message, Object... values) Log a warning message with the corresponding throwable being logged at debug level. logger.warn(String.format("%s (details at debug level)", message), values); logger.debug("Stacktrace of the preceding warning", t); |
void | notNull(String message, Object obj) not Null if (obj == null) { throw new NullPointerException(message); |