是否有可能将show_sql的所有输出放在单独的文件中? [英] Is it possible to put all output from show_sql in a separate file?

查看:178
本文介绍了是否有可能将show_sql的所有输出放在单独的文件中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在本地开发或运行使用hibernate的spring mvc应用程序时,如果我可以将所有sql的输出结果分别存储到单独的文件中,那将是非常好的选择。



是这可能吗?



我知道有一个hibernate属性show_sql,但我相信这只会与其他所有log4j日志信息混淆在一起,是正确的吗?

解决方案将 org.hibernate.SQL 类别设置为 DEBUG

$ h















li> 3.5。记录

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?

解决方案

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

See also

这篇关于是否有可能将show_sql的所有输出放在单独的文件中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆