Spring JDBC is not logging SQL with log4j

后端 未结 6 1840
慢半拍i
慢半拍i 2020-12-11 20:06

I\'m researching spring for a possible switch to a spring stack. One of the things that I thought was cool was the ability for spring jdbc to log all the executed sql. So

6条回答
  •  渐次进展
    2020-12-11 20:49

    Try

    log4j.category.org.springframework.jdbc.core = TRACE
    

    This helped me, DEBUG just wasn't enough. I am using org.springframework.jdbc-3.0.6.RELEASE.jar with log4j-1.2.15 and slf4j (1.6.4)

    For just an SQL (i.e. if you're not interested in bound parameter values) DEBUG should be enough.

提交回复
热议问题