Does Hibernate log the values that it assigns to placeholders in prepared SQL statements? How can configure Log4j so that it writes these values to my log files?
Hibernate utilizes Simple Logging Facade for Java (SLF4J) in order to log various system events. SLF4J can direct your logging output to several logging frameworks (NOP, Simple, log4j version 1.2, JDK 1.4 logging, JCL or logback) depending on your chosen binding.
We do use Log4j during development of the Hibernate libraries as it's a dependency of our testsuites; therefore we've still upgraded all branches. These test dependencies won't be included in your application if you depend on the Hibernate libraries. The upgraded versions of each project are: Hibernate ORM: 5.3.
Yes it does (see the Chapter 3.5 Logging). Activate logging of the following categories:
log4j.logger.org.hibernate.SQL=DEBUG
log4j.logger.org.hibernate.type=TRACE
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