Hibernate log using hibernate.stat

自作多情 提交于 2019-12-12 21:04:42

问题


I am using log4j.xml to config my hibernate logging. I used org.hibernate.stat to view the statistics. However I am not able to view the specific SQL statement with the statistics. I do not want to use hibernate.SQL as I want to view the time taken to process the respective query.

Below is a segment of my log4j.xml file:

<category name="org.hibernate.stat">
    <level value="debug"/>
    <appender-ref ref="LOG_FILE"/>
</category>

<category name="org.hibernate">
    <priority value="debug" />      
</category>

However when I print out (refer to a segment of my Log file below) , I am only able to view the stored procedures called by hibernate but not the queries which are all reflected as null. Furthermore, it seems like the log level is INFO instead of DEBUG.

Nov-01 17:29:55,106 (INFO) [org.hibernate.stat.Statistics] HQL: null, time: 67ms, rows: 56
Nov-01 17:30:00,949 (INFO) [org.hibernate.stat.Statistics] HQL: null, time: 8ms, rows: 1
Nov-01 17:30:07,169 (INFO) [org.hibernate.stat.Statistics] HQL: { call News_GetNews(?, ?) }, time: 20ms, rows: 1

Can Anyone Advise? Thank You Very Much

来源:https://stackoverflow.com/questions/40357402/hibernate-log-using-hibernate-stat

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!