Issue
I want to log all SQL-Statements in SpringBoot 2.7.0. In https://www.baeldung.com/sql-logging-spring-boot#2-via-loggers it is done via the following properties:
class="lang-yaml prettyprint-override">spring.jpa.properties.hibernate.format_sql: true
logging.level.org.hibernate.SQL: DEBUG
logging.level.org.hibernate.type.descriptor.sql.BasicBinder: DEBUG
This works fine as long as I use the .yml
-File. But I have to set it via Environment Variables in OpenShift.
Unfornenatly the Docs https://github.com/spring-projects/spring-boot/wiki/Relaxed-Binding-2.0#environment-variables don't say much about the writing of
format_sql
(underscore in property)hibernate.SQL
(all uppercase)sql.BasicBinder
(CamelCase in property)
I've tried the following ones, but none of them work:
LOGGING_LEVEL_ORG_HIBERNATE_SQL=DEBUG
LOGGING_LEVEL_ORG_HIBERNATE_TYPE_DESCRIPTOR_SQL_BASICBINDER=TRACE
SPRING_JPA_PROPERTIES_HIBERNATE_FORMAT_SQL=true
Any ideas?
Solution
Use name : logging.level.org.hibernate.SQL
Answered By - Slongtong
Answer Checked By - Clifford M. (JavaFixing Volunteer)