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 { public static Logger getLogger() { final Throwable t = new Throwable(); t.fillInStackTrace();//from ww w . j a v a 2 s. c o m final String clazz = t.getStackTrace()[1].getClassName(); return LoggerFactory.getLogger(clazz); } }