Log4j + WebSphere V7 配置说明
关键配置:
1、 commons-logging.properties配置。
2、 部署时配置类装入顺序。
1、 需要配置:
项目类路径根目录(如classes下面)建立属性文件:
commons-logging.properties
内容为:
priority=1
#for commons-logging-1.1.x
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
#for commons-logging-1.0.x
#org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4jFactory
2、 选择“类装入和更新检测”
选择类转入顺序和策略,
选中:
类装入器顺序 -->类已装入并且是先使用本地类装入器(父类最后)
WAR 类装入器策略 -->应用程序的单个类装入器
确定。
然后重启应用即可(不需要重启WebSphere)。
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/myloon/archive/2009/09/24/4587361.aspx