How to log final SQL queries with hibernate

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 02:56:12

问题


Is it possible to log not HQL queries but final queries when using hibernate. I mean, the one that is sent to the database. I've tried different log level but I haven't seen it. And in my opinion it would be useful to debug some issues.

Thank you very much.


回答1:


Yes, it's possible. That's what the hibernate.show_sql property does. You may also have finer control using the logging configuration:

org.hibernate.SQL           Log all SQL DML statements as they are executed
org.hibernate.type          Log all JDBC parameters
org.hibernate.tool.hbm2ddl  Log all SQL DDL statements as they are executed


来源:https://stackoverflow.com/questions/11689432/how-to-log-final-sql-queries-with-hibernate

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