Here you can find the source of get(Class> clazz)
private static Logger get(Class<?> clazz)
//package com.java2s; //License from project: Apache License import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Main { @SuppressWarnings("rawtypes") private static final ConcurrentMap<Class, Logger> loggers = new ConcurrentHashMap<Class, Logger>(); private static Logger get(Class<?> clazz) { if (clazz == null) { return null; }//from w w w . ja v a 2 s. c o m Logger logger = loggers.get(clazz); if (logger == null) { logger = LoggerFactory.getLogger(clazz); loggers.put(clazz, logger); } return logger; } private static Logger get(Object obj) { if (obj == null) { return null; } Class<?> clazz = obj.getClass(); Logger logger = loggers.get(clazz); if (logger == null) { logger = LoggerFactory.getLogger(clazz); loggers.put(clazz, logger); } return logger; } }