Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Hibernate log the values that it assigns to placeholders in prepared SQL statements?

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?

like image 410
Derek Mahar Avatar asked Jun 14 '10 21:06

Derek Mahar


People also ask

What is logging in hibernate?

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.

Does hibernate use Log4j?

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.


1 Answers

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
like image 199
Pascal Thivent Avatar answered Sep 19 '22 11:09

Pascal Thivent