log.debug(e.getMessage());

private static final Log log = LogFactory.getLog(AbcAction.class);
@ManagedProperty(name = "abcService", value = "#{abcService}")
private AbcService abcService;
private Abc newItem = new Abc();
public void add() {
try {
extVarConfigService.saveExtVarConfig(newItem);
dataModel.refresh();
} catch (Throwable e) {
log.debug(e.getMessage());

}

这里LogFactory明显是使用了工厂模式。把很多类的创建器放在一起使用参数来调用。这里AbcAction.class是参数,意思是调用之前定义好的,和这个class相关的Log类的创建器,构造一个Log类并返回,然后赋值给Log。
这里Log接口也不是Java的通用东西,它具有debug方法,从名字看,意思是把DEBUG信息LOG下来。e.getMessage()就是取Throwable的具体信息。

原文地址:https://www.cnblogs.com/jobs2/p/3145528.html