Can't avoid hibernate logging SQL to console with Spring Boot and Logback

后端 未结 5 1658
失恋的感觉
失恋的感觉 2020-12-15 05:23

My Spring Boot application keeps showing Hibernate queries in the console despite having configured Hibernate\'s specific logging with Logback as follows:

&l         


        
5条回答
  •  清歌不尽
    2020-12-15 05:33

    I just wanted to share that I just noticed there is another setting which could cause org.hibernate.SQL to debug in Spring Boot JUnit tests, though you might have set

    spring.jpa.show-sql=false 
    

    and

    spring.jpa.properties.hibernate.show_sql=false
    

    ...

    If you set

    debug=true
    

    in your Spring application*.properties file!

    This one set to true will override the show-sql setting and set it to true.

    Brgds

提交回复
热议问题