给你一个我们的项目文件自己看吧。。
希望老板别发现。。。
# Global logging configuration
log4j.rootLogger=INFO,file
# SqlMap logging configuration...
log4j.logger.com.ibatis=INFO
log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG
log4j.logger.com.ibatis.common.jdbc.ScriptRunner=INFO
log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=INFO
log4j.logger.java.sql.Connection=INFO
log4j.logger.java.sql.Statement=INFO
log4j.logger.java.sql.PreparedStatement=INFO
log4j.logger.java.sql.ResultSet=INFO
# Console output...
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Threshold=DEBUG
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n
log4j.appender.stdout.Target=System.out
##########################
#log4j.appender.stdout.layout.ConversionPattern=[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n
#log4j.appender.stdout.layout.ConversionPattern=[start]%d{DATE}[DATE]%n%p[PRIORITY]%n%x[NDC]%n%t[THREAD] n%c[CATEGORY]%n%m[MESSAGE]%n%n
# File output by days...
log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
log4j.appender.file.Threshold=ERROR
log4j.appender.file.file=${catalina.base}/logs/psp_error.log
log4j.appender.file.MaxFileSize=2000KB
log4j.appender.file.DatePattern="."yyyy-MM-dd
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d %p [%c] - %m%n
# HTML output...
log4j.appender.sql_html=org.apache.log4j.RollingFileAppender
log4j.appender.sql_html.Threshold=DEBUG
log4j.appender.sql_html.File=${catalina.base}/logs/psp_sql.html
log4j.appender.sql_html.MaxFileSize=5000KB
log4j.appender.sql_html.MaxBackupIndex=1
log4j.appender.sql_html.layout=org.apache.log4j.HTMLLayout
看看我的
#--------------------------------
# 设定logger的root level为DEBUG,指定的输出目的地(appender)为A1
log4j.rootLogger=DEBUG, A1
# 设定调试信息的输出位置,此处设定输出为控制台
log4j.appender.A1=org.apache.log4j.ConsoleAppender
# 设定调试信息的输出位置,此处设定输出为convert.log文件
# log4j.appender.A1=org.apache.log4j.RollingFileAppender
#log4j.appender.A1.File=convert.log
# log4j.appender.A1.MaxFileSize=1000KB
# 设定制定的A1使用的PatternLayout.
# 有关ConversionPattern中的转意字符的含义参考说明
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d %-5p [%t] %C{2} (%F:%L) - %m%n
#log4j.appender.A1.layout=org.apache.log4j.HTMLLayout
昏
为什么要创建在项目里面?