如何在struts2+ spring+ ibatis 框架中配置log4j让控制台显示sql语句
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何在struts2+ spring+ ibatis 框架中配置log4j让控制台显示sql语句相关的知识,希望对你有一定的参考价值。
参考技术A 这个不是在log4j里面配置的,log4j只是记录执行操作的日志,这个需要在一个xml配置文件里面配置<!-- 日志记录的SQL监控 --> <plugin interceptor="com.cmsz.framework.log.sqlmonitor.IBatis3SqlMonitorPlugin"> <property name="printSql" value="true"></property> </plugin>
这个是配置文件需要些的代码,只要这个配置好了,控制台就可以显示sql语句了
这里面的interceptor需要写一个监听类
以上是关于如何在struts2+ spring+ ibatis 框架中配置log4j让控制台显示sql语句的主要内容,如果未能解决你的问题,请参考以下文章
ibatis selectkey返回值在spring中怎么取
Struts2 + ibatis 框架,如何在一个页面里显示当前登录的用户?
用struts+spring+hibernate/ibatis 框架配合,写一个输入用户名、密码,然后到数据库校验的功能