jdbc.properties configuration file for log4j
#configuring the custom logger
log4j.logger.com.apress.logging.log4j=DEBUG, DB
log4j.appender.DB=org.apache.log4j.jdbc.JDBCAppender
log4j.appender.DB.URL=jdbc:odbc:dbdef
log4j.appender.DB.user=system
log4j.appender.DB.password=manager
log4j.appender.DB.sql=INSERT INTO LOGGING_DATA VALUES('%x','%d{yyyy-MM-dd}','%C','%p','%m')
Related examples in the same category