Java slf4j 中的 error 输出怎么写

可以按照下面的写法

[code]public class MyClass{

private static Logger logger = Logger.getLogger(MyClass.class);

public ReturnType myMethod(Param p, Param2 p2) {


try {

} catch(MyException e) {
logger.log(“Exceptions happen!”, e); //this will put all the details in log file configured earlier
}

}


}[/code]

直接写:

catch (Exception e) { logger.error("Folder List is NULL", e); }

就可以了。