Java slf4j Logger getLogger()

Here you can find the source of getLogger()

Description

get Logger

License

Open Source License

Declaration

public static Logger getLogger() 

Method Source Code


//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;
        }
    }
}

Related

  1. getErrorMsg(String format, Object[] argArray)
  2. getIntValue(String strVal, int defVal)
  3. getLog(Class clazz)
  4. getLogger()
  5. getLogger()
  6. getLogger(Class clazz)
  7. getLogger(Class clazz)
  8. getLogger(Class clazz)
  9. getLogger(String className)