禁用从DriverManagerDataSource记录

时间:2013-12-09 09:33:31

标签: spring-mvc jdbc properties connection log4j

我想从我的每日日志文件中过滤掉这个日志。
示例行:

"09-12-2013 05:16:06 [DEBUG] http-8080-2 (DriverManagerDataSource.java:getConnectionFromDriver:162) Creating new JDBC DriverManager Connection."

我的Log4j.properties文件是

log4j.rootLogger=OFF 
log4j.logger.com.lhub = DEBUG, FILE
log4j.appender.FILE=org.apache.log4j.DailyRollingFileAppender  
log4j.appender.FILE.File=${catalina.home}/logs/E-Attendance-logs/myapp.log
log4j.appender.FILE.Append=true 
log4j.appender.FILE.DatePattern='.'yyyy-MM-dd
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout 
log4j.appender.FILE.layout.ConversionPattern=%d{dd-MM-yyyy hh:mm:ss} [%5p] %t (%F:%M:%L) %m%n

知道该怎么做吗?

1 个答案:

答案 0 :(得分:0)

在文件中添加下一行:

log4j.logger.org.springframework.jdbc.datasource.DriverManagerDataSource=OFF