#console output log4j.rootLogger=ERROR,appender1,appender2 log4j.appender.appender1=org.apache.log4j.ConsoleAppender log4j.appender.appender1.layout=org.apache.log4j.SimpleLayout #file output log4j.appender.appender2=org.apache.log4j.FileAppender log4j.appender.appender2.File=D:\\log4j.html log4j.appender.appender2.layout=org.apache.log4j.HTMLLayout
1.log4j 在控制檯輸出,在D:\\log4j.html 中以表格的形式輸入。 html
2.導入包:log4j-1.2.15.jar java