I'm using spring-boot
autoconfiguration for database injection, with properties defined:
spring.jpa.database=POSTGRESQL spring.jpa.show-sql=true spring.jpa.hibernate.ddl-auto=update
But how can I set the hibernate.format_sql=true
? Is that not supported by spring boot?
Format the generated SQL statement to make it more readable, but takes up more screen space. 🙂 <!-- hibernate.cfg.xml --> <property name="format_sql">true</property> Output.
Activating Logging in Hibernate To activate the logging of the executed SQL statements with Spring Boot, set the log level of the org. hibernate. SQL category to DEBUG . If you wish to see the bind values, you can set the log level of org.
Spring Boot will let you set any available hibernate property using:
spring.jpa.properties.*
So spring.jpa.properties.hibernate.format_sql=true
would work as well.
Check out this part of the documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With