Only work when put sql in layout.ConversionPattern, if put in .sql it will never work.

log4j.logger.db.logging=DEBUG, dblog
log4j.additivity.db.logging=false
log4j.appender.dblog=org.apache.log4j.jdbc.JDBCAppender
log4j.appender.dblog.URL=jdbc:postgresql://localhost:5432/logging_db
log4j.appender.dblog.driver=org.postgresql.Driver
log4j.appender.dblog.layout=org.apache.log4j.EnhancedPatternLayout
log4j.appender.dblog.user=user
log4j.appender.dblog.password=password
log4j.appender.dblog.layout.ConversionPattern=INSERT INTO db_log(server_ts, message) values(TIMESTAMP '%d{yyyy-MM-dd HH:mm:ss}', '%properties{message}')