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

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

问题描述

我想在控制台或文件中登录 Grails 执行的所有查询,以检查性能.

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.

推荐答案

设置

datasource {
...
logSql = true
}

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

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天全站免登陆