开发者

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

I was able the get the below log

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

after specifying the log4j 开发者_开发问答properties as

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

Is there a way to tell hibernate 3.2.x to show the binding column name instead of the column number? i.e. I'd like to see the log line as

[main] DEBUG org.hibernate.type.LongType  - binding '0' to parameter: SYSTEMID


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

If you still have problems, try enabling trace on these too

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

In addition make sure you have TRACE logging enabled in your config. Many times default config files will set logging at DEBUG as the lowest.


Use log4j.logger.org.hibernate=debug

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜