配置了ibatis打印sql的log4j.xml文件
在tomcat下可以打印出sql语句。但是将环境换成was,无法打印。
上网搜了一下,原来was默认输出log是以common-logging.jar实现的,但是在应用里我配置的是log4j。
解决办法:
1.在类路径下增加commons-logging.properties配置文件,文件内容为:
priority=1
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl 2.将类加载方式改成parent_last
[
本帖最后由 portal 于 2010-2-9 02:04 编辑 ]