Here you can find the source of getLogger()
public static Logger getLogger()
//package com.java2s; //License from project: Open Source License import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Main { private static ThreadLocal<Logger> currentLoggerMap = new ThreadLocal<>(); private static Logger defaultLogger = LoggerFactory.getLogger("defaultLogger"); public static Logger getLogger() { Logger logger = currentLoggerMap.get(); if (null == logger) { return defaultLogger; } else {/*w ww . j ava 2 s . c o m*/ return logger; } } }