日志接口与日志框架
日志接口:commons-logging(jcl)与slf4j
日志框架:jdk自带的logging(jul)、log4j1、log4j2、logback
JUL实现JCL:
private static Log logger=LogFactory.getLog(JulJclTest.class);
public static void main(String[] args){
if(logger.isTraceEnabled()){
logger.trace("commons-logging-jcl trace message");
}
if(logger.isDebugEnabled()){
logger.debug("commons-logging-jcl debug message");
}
if(logger.isInfoEnabled()){
logger.info("commons-logging-jcl info message");
}
}

浙公网安备 33010602011771号