Search code examples
javaspringspring-bootspring-data-jpayaml

Spring enable SQL logs in application.yml


I'm building a spring boot application. I'm trying to enable SQL logs in application.yml. How can I do it?


Solution

  • We can use any one of these:

    spring:
      jpa:
        show_sql: true
    

    or

    logging:
      level:
        org:
        hibernate:
            sql:debug
            type:
            descriptor:
                sql:trace