* Commons Logging [#qbb4a0fc]
*** /App01/src/jp/sample/myapp/App01.java [#h0913441]
package jp.sample.myapp;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class App01 {
public static void main(String[] args) {
Log log = LogFactory.getLog(App01.class);
log.debug("DEBUG: DEBUG");
log.fatal("DEBUG: FATAL");
log.info( "DEBUG: INFO");
}
}
*** /App01/src/log4j.properties [#o865529f]
log4j.rootLogger=INFO,myconsole
log4j.appender.myconsole=org.apache.log4j.ConsoleAppender
log4j.appender.myconsole.Target=System.out
log4j.appender.myconsole.layout=org.apache.log4j.PatternLayout
log4j.appender.myconsole.layout.ConversionPattern=%d [%t] %-5p %c(%L) - %m%n
*** /App01/src/commons-logging.properties [#na055874]
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
** 参考 [#c70ef5b0]
http://commons.apache.org/logging/
- http://commons.apache.org/logging/
- http://logging.apache.org/log4j/1.2/