log4j的debug输出和JAVA类写法

java类中的写法:
private static final Log logger = LogFactory.getLog(JadeInvocationHandler.class);   
  
final boolean debugEnabled = logger.isDebugEnabled();   
        if (debugEnabled) {   
            logger.debug("invoking " + daoMetaData.getDAOClass().getName() + "#" + method.getName());   
        }  


log4j.properties中的写法:

log4j.rootLogger=INFO, stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n

log4j.logger.net.paoding.rose.jade.jadeinterface=DEBUG
log4j.logger.net.paoding.rose.jade.context.JadeInvocationHandler=DEBUG

注意最后两行

你可能感兴趣的:(log4j,log,LogFactory,Logger,getlog)