Java slf4j Logger getLogger(Class clazz)

Here you can find the source of getLogger(Class clazz)

Description

get Logger

License

Open Source License

Declaration

public static Logger getLogger(Class clazz) 

Method Source Code


//package com.java2s;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Hashtable;

public class Main {
    private static Hashtable<Class, Logger> loggerCache = new Hashtable<>();

    public static Logger getLogger(Class clazz) {
        // Class clazz = objInstance.getClass();
        Logger ret = loggerCache.get(clazz);
        if (ret == null) {
            ret = LoggerFactory.getLogger(clazz);
            loggerCache.put(clazz, ret);
        }/*from w  w  w .  jav  a  2  s  . com*/

        return ret;
    }
}

Related

  1. getLog(Class clazz)
  2. getLogger()
  3. getLogger()
  4. getLogger()
  5. getLogger(Class clazz)
  6. getLogger(Class clazz)
  7. getLogger(String className)
  8. getLoggerForCurrentClass()
  9. getLoggerInstance(String callerCLass)