How do I tell hibernate to print the column name instead of the column number in the log?

I managed to get the next magazine

Hibernate: insert into ORGANIZATIONALUNITCATALOG (ID, SYSTEMID) values (null, ?)
[main] DEBUG org.hibernate.type.LongType  - binding '0' to parameter: 1

after setting log4j properties as

log4j.logger.org.hibernate.sql=DEBUG
log4j.logger.org.hibernate.type=DEBUG

Is it possible to specify hibernate 3.2.x to display the binding column name instead of the column number? those. I would like to see the log line as

[main] DEBUG org.hibernate.type.LongType  - binding '0' to parameter: SYSTEMID
+3
source share
2 answers

log4j.logger.org.hibernate.type=TRACE must do it.

If you still have problems, try enabling tracing on them too

log4j.logger.org.hibernate.SQL=TRACE
log4j.logger.org.hibernate.engine.query=TRACE
log4j.logger.org.hibernate.jdbc=TRACE

In addition, make sure that TRACE logging is enabled in your config. Many times, by default, configuration files set the registry to DEBUG as the lowest.

+1
source

Use log4j.logger.org.hibernate=debug

0
source

All Articles