码迷,mamicode.com
首页 > 其他好文 > 详细

解决 jboss和log4j的冲突问题

时间:2017-09-20 14:23:58      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:cte   out   help   source   --   hang   exception   org   code   

日志错误内容:

ERROR: invalid console appender config detected, console stream is looping

 

 

方案1:

你先將你程式內部的 log4j.properties or log4j.xml 全部拿掉,再 deploy 
看看。如果沒問題再逐一將 自己的 config 一項一項放進 
/jboss/server/default/conf/log4j.xml 測試。 


方案2:

去[JBOSS_HOME]/server/default/conf/log4j.xml 改或加自己的設定這不太make sense,最好還是要針對個別application有自己的log4j設定檔比較合理。其實application若有自己的log4j war及設定檔,而導致JBoss啟動時出現 "ERROR: invalid console appender config detected, console stream is looping." 錯誤訊息時,只要去JBoss server層的conf資料夾中的jboss-service.xml中的org.jboss.logging.Log4jService的設定區段中加個參數:<attribute name="CatchSystemOut">false</attribute>即可,如: 

 

<mbean code="org.jboss.logging.Log4jService"
name="jboss.system:type=Log4jService,service=Logging"
xmbean-dd="resource:xmdesc/Log4jService-xmbean.xml">
<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="CatchSystemOut">false</attribute>
<attribute name="Log4jQuietMode">true</attribute>
<!-- How frequently in seconds the ConfigurationURL is checked for changes -->
<attribute name="RefreshPeriod">60</attribute>
</mbean>

解决 jboss和log4j的冲突问题

标签:cte   out   help   source   --   hang   exception   org   code   

原文地址:http://www.cnblogs.com/mountainTop/p/7560650.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!