c3p0连接池的log4j日志配置

在log4j.properties中加入:
#c3p0
log4j.logger.com.mchange.v2.resourcepool.BasicResourcePool=DEBUG,C1

#c3p0 appender
log4j.appender.C1=org.apache.log4j.RollingFileAppender
log4j.appender.C1.File=${catalina.base}/webapps/ROOT/logs/c3p0.log
log4j.appender.C1.MaxFileSize=500KB
log4j.appender.C1.MaxBackupIndex=100
log4j.appender.C1.layout=org.apache.log4j.PatternLayout
log4j.appender.C1.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%c]-[%p] %m%n

效果如下:
[img]http://dl.iteye.com/upload/attachment/350676/3bc11eb0-a0f9-325e-9bd8-86fd930c966c.jpg[/img]

你可能感兴趣的:(c3p0连接池的log4j日志配置)