问题
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