JPA添加sql输出日志
org.bgee.log4jdbc-log4j2
log4jdbc-log4j2-jdbc4.1
1.16
- 添加log4jdbc.log4j2.properties文件
log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator
#旧版
spring:
datasource:
url: jdbc:mysql://xxxx:3306/xxxx?useUnicode=true&characterEncoding=UTF8
username: xxxx
password: xxxx
sql-script-encoding: utf-8
# 新版
spring:
datasource:
url: jdbc:log4jdbc:mysql://xx.xx.xx.xx:3306/xxxx?useUnicode=true&characterEncoding=UTF8
username: xxxx
password: xxxx
sql-script-encoding: utf-8
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy