log4j.logger.org.springframework.jdbc.core.StatementCreatorUtils=debug
但是设置后打印的内容只包含sql语句,不包含参数信息

经过多方寻找都是上文的解决方案,后来在此找到了结果:http://stackoverflow.com/questions/1932208/seeing-the-underlying-sql-in-the-spring-jdbctemplate 需要设置:log4j.logger.org.springframework.jdbc.core.StatementCreatorUtils=TraceJdbcTemplate 还是设为debug
如下:#输出SQL语句log4j.logger.org.springframework.jdbc.core.JdbcTemplate=debug#输出参数值log4j.logger.org.springframework.jdbc.core.StatementCreatorUtils=Trace
来自为知笔记(Wiz)
jdbcTemplate:包含占位符的SQL无法打印参数信息
标签: