Affects: \
Hibernate exposed the fancy 'SQL highlight' feature since v5.5 (see the PR at https://github.com/hibernate/hibernate-orm/pull/3553). It uses ANSI escape codes to make the logged SQL statements more readable. Below is an example (the SQL keywords are highlighted with special colors)
It seems a good idea to expose this Hibernate option, together with 'show_sql' and 'format_sql' options we have exposed already.
Comment From: snicoll
@NathanQingyangXu it looks like that you intended to report that against the Spring Boot project? I am going to move this issue for their consideration. As for the framework itself, there's nothing that need to be done as you can configure any Hibernate settings the usual way already.
Comment From: wilkinsona
We have a specific property for showing SQL as it's a setting on Spring Framework's AbstractJpaVendorAdapter. We don't, as far as I know, have a property for format_sql as it's Hibernate-specific.
As described in the documentation, you can configure Hibernate specific properties using the spring.jpa.properties prefix. For example, to format and highlight SQL, add the following to your configuration:
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.highlight_sql=true
Thanks anyway for the suggestion, but I don't think we should add a property specifically for highlighting SQL. The configuration shown above should be used instead.