如何在grails 1.3.7中记录sql

编程入门 行业动态 更新时间:2024-10-26 07:31:36
本文介绍了如何在grails 1.3.7中记录sql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我尝试在数据源(测试环境)中使用logSql = true在grails中配置sql的日志,但是在测试输出中没有显示任何内容。 我读过这篇文章,但是这是行不通的。

如何在Grails中记录SQL语句

谢谢 解决方案

我们在Config.groovy中完成了它,

log4j = { // ...任何 debug'org.hibernate.SQL','org.hibernate.transaction'//可选}

自Grails 1.1以来,Log4j的配置有所不同。

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

解决方案

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 1.3.7中记录sql

本文发布于:2023-10-22 23:59:50,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   grails   sql

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!