日志接口与日志框架

日志接口: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");
    }
}
posted @ 2022-06-15 13:59  无极是一种信仰  阅读(41)  评论(0)    收藏  举报