I am trying to debug connection leak in my Struts application and have set-up log4jdbc. I am able to see log4jdbc logs in console but I wish to have jdbc connection open/close events being written to a log file. Below is my log4j.properties file
log4j.debug=true
! Log connection open/close events and connection number dump
log4j.logger.jdbc.connection=INFO,connection
log4j.additivity.jdbc.connection=false
! the appender used for the JDBC Connection open and close events
log4j.appender.connection=org.apache.log4j.RollingFileAppender
log4j.appender.connection.File=C:/dev/myworkspace/log/connection.log
log4j.appender.connection.layout=org.apache.log4j.PatternLayout
log4j.appender.connection.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c{1} - %m%n
log4j.appender.connection.MaxFileSize = 2000KB
log4j.appender.connection.MaxBackupIndex = 10
Please suggest what is wrong with my properties file as the logs are not written in connection.log file ?
Try out this,
For Connection settings: