配置log4j的log4j.properties的配置文件
log4j.logger.jdbc.sqlonly=DEBUG,console
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %m%n%n
log4j.logger.jdbc.sqltiming=INFO,console
log4j.logger.jdbc.connection=INFO,console
修改dbconfig.properties配置文件的url和driverClassName
url:jdbc:log4jdbc:mysql://localhost:3306/xdptest
driverClassName:net.sf.log4jdbc.DriverSpy
username:root
password:root
filters:stat
maxActive:200
initialSize:20
maxWait:60000
minIdle:10
timeBetweenEvictionRunsMillis:60000
minEvictableIdleTimeMillis:300000
validationQuery:SELECT 'x'
testWhileIdle:true
testOnBorrow:false
testOnReturn:false
removeAbandoned:false
removeAbandonedTimeout:1800
logAbandoned:true