如何在Grails中记录SQL语句 [英] How to log SQL statements in Grails

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

问题描述

我希望登录控制台或文件中的所有Grails所做的查询来检查性能。

我配置了

任何想法都会有帮助。

解决方案设置

 数据源{
...
logSql = true
}

在DataSource.groovy中(根据这些说明)足以让它在我的环境中工作。似乎常见问题的部分内容已过时(例如多对多列向后问题),因此这可能也会在此期间发生变化。


I want to log in the console or in a file, all the queries that Grails does, to check performance.

I had configured this without success.

Any idea would help.

解决方案

Setting

datasource {
...
logSql = true
}

in DataSource.groovy (as per these instructions) was enough to get it working in my environment. It seems that parts of the FAQ are out of date (e.g. "the many-to-many columns backwards" question) so this might also be something that changed in the meantime.

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

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