项目中常常需要日志对象logger;
总是在代码的前面部分放上这段代码private final Logger logger = LoggerFactory.getLogger(AdController.class
这段代码调用了org.slf4j.LoggerFactory
public static Logger getLogger(Class clazz) {
return getLogger(clazz.getName());
}
<a href="http://blog.csdn.net/zjlgdxzzw/article/details/45093607#" target="_blank">copy</a>
public static Logger getLogger(String name) {
ILoggerFactory iLoggerFactory = getILoggerFactory();
return iLoggerFactory.getLogger(name);
本文转自建波李 51CTO博客,原文链接:http://blog.51cto.com/jianboli/1904028,如需转载请自行联系原作者