以下是我的log4j2.properties
文件的内容。它打印sql,但不打印参数。如何添加org.hibernate.type=trace
或类似的打印参数?
appenders = console, file
appender.console.type = Console
appender.console.name = STDOUT
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = [%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n
appender.file.type = File
appender.file.name = File
appender.file.fileName = app.log
appender.file.layout.type = PatternLayout
appender.file.layout.pattern = [%-5level] %d{dd-MM-yyyy HH:mm:ss.SSS} [%t] %c{1} - %msg%n
rootLogger.level = info
rootLogger.appenderRefs = stdout
rootLogger.appenderRef.stdout.ref = STDOUT
rootLogger.appenderRef.file.ref = File
logger.hibernate.name=org.hibernate.SQL
logger.hibernate.level=debug
您应该再添加一个记录器:
logger.hibernate-type.name=org.hibernate.type
logger.hibernate-type.level=trace