user2427 user2427 - 2 years ago 109
SQL Question

How to log SQL statements in 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.

Answer Source


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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download