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

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

问题描述

我尝试在数据源(测试环境)中使用 logSql=true 为 grails 中的 sql 配置日志,但测试输出中未显示任何内容.

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.

如何在 Grails 中记录 SQL 语句

谢谢

推荐答案

我们在 Config.groovy 中做到了,

We did it in Config.groovy,

log4j = {
// ... whatever

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

Log4j 的配置与 Grails 1.1 不同.

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

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