How to log sql in grails 1.3.7

2019-02-17 13:43发布

问题:

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

回答1:

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 gorm