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

后端 未结 5 1657
失恋的感觉
失恋的感觉 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-15 05:35

    My application is a spring-boot one,

    For some reason in my case the property 'spring.jpa.show-sql=false' didn't work. I could see the sql with the bind values keep on printing the queries in the console/log.

    It is resolved by changing the root level to error like below

    Though we change log level to error in the root, we still can print our package/application logs in the info mode my using the separate loggers like below

    putting here so it might help someone.

    Thanks

提交回复
热议问题