楼主的log4j.xml是否在应用服务器里面?如在:jboss。缺省配置是需要修改jboss的jboss-service.xml的配置文件的。对比一下如下的配置和你的jboss-service。xml文件
<!-- ==================================================================== -->
<!-- Log4j Initialization -->
<!-- ==================================================================== --> <mbean code="org.jboss.logging.Log4jService"
name="jboss.system:type=Log4jService,service=Logging">
<attribute name="ConfigurationURL">resource:log4j.xml</attribute>
<!-- Set the org.apache.log4j.helpers.LogLog.setQuiteMode. As of log4j1.2.8
this needs to be set to avoid a possible deadlock on exception at the
appender level. See bug#696819.
-->
<attribute name="Log4jQuietMode">true</attribute>
<attribute name="CatchSystemOut">false</attribute> </mbean>
<!-- ==================================================================== -->
<!-- Log4j Initialization -->
<!-- ==================================================================== --> <mbean code="org.jboss.logging.Log4jService"
name="jboss.system:type=Log4jService,service=Logging">
<attribute name="ConfigurationURL">resource:log4j.xml</attribute>
<!-- Set the org.apache.log4j.helpers.LogLog.setQuiteMode. As of log4j1.2.8
this needs to be set to avoid a possible deadlock on exception at the
appender level. See bug#696819.
-->
<attribute name="Log4jQuietMode">true</attribute>
<attribute name="CatchSystemOut">false</attribute> </mbean>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货