Is it possible to put all output from show_sql in a separate file?

一个人想着一个人 提交于 2019-12-23 09:37:12

问题


When developing or running a spring mvc app locally that uses hibernate, it would be nice if I could get the output of all sql to a separate file.

Is this possible?

I know there is a hibernate property show_sql but I believe that will just get jumbled together with all other log4j logging info, correct?


回答1:


Set the org.hibernate.SQL category to DEBUG and use a specific appender for it.

See also

  • 3.5. Logging


来源:https://stackoverflow.com/questions/3285041/is-it-possible-to-put-all-output-from-show-sql-in-a-separate-file

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