Turn off hibernate logging to console

后端 未结 5 1314
死守一世寂寞
死守一世寂寞 2020-12-30 02:01

When running my Spring/Hibernate application I see the following unwanted output on the console:

Hibernate: select securityus0_.ID ....
Hibernate: select sec         


        
相关标签:
5条回答
  • 2020-12-30 02:41

    I'm fairly certain that you're seeing those SQL statements because somewhere in your Hibernate config the property "hibernate.show_sql" is set to true. Find that setting and change to false.

    0 讨论(0)
  • 2020-12-30 02:47

    If you are using an application.yml file based on your configuration you may find the property show-sql:true under the jpa property.

    0 讨论(0)
  • 2020-12-30 02:49

    Solved this by adding:

    <property name="hibernate.show_sql" value="false"/>
    

    in the persistence.xml file, this is if you have one

    0 讨论(0)
  • 2020-12-30 03:03

    If you have a persistence.xml file try there. That's where I found it.

    0 讨论(0)
  • 2020-12-30 03:08

    Set the below to false in applications.properties file:

    spring.jpa.show-sql=false
    

    it will turn off Hibernation messages.

    0 讨论(0)
提交回复
热议问题