如何在grails 1.3.7中记录sql [英] How to log sql in grails 1.3.7

查看:99
本文介绍了如何在grails 1.3.7中记录sql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在数据源(测试环境)中使用logSql = true在grails中配置sql的日志,但是在测试输出中没有显示任何内容。 我读过这篇文章,但是这是行不通的。



如何在Grails中记录SQL语句



谢谢 解决方案

我们在Config.groovy中完成了它,

  log4j = {
// ...任何

debug'org.hibernate.SQL',
'org.hibernate.transaction'//可选
}

自Grails 1.1以来,Log4j的配置有所不同。


I try to configure logs for sql in grails with logSql=true in datasource (test env) but nothing is displayed in test output.

I read this post but It's not working.

How to log SQL statements in Grails

Thanks

解决方案

We did it in Config.groovy,

log4j = {
// ... whatever

    debug    'org.hibernate.SQL',
             'org.hibernate.transaction' // optionally
}

Log4j is configured differently since Grails 1.1.

这篇关于如何在grails 1.3.7中记录sql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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