jboss 也采用了log4j 记录日志,
项目中也有一个log4j.properties, 由于都配置了
org.apache.log4j.ConsoleAppende
这样会 有冲突, 启动时出现ERROR: invalid console appender config detected, console stream is looping.
log4j.rootLogger= DEBUG, FILE, ROLLING_FILE,CONSOLE2 log4j.logger.com.gs = DEBUG log4j.logger.com.opensymphony.oscache = INFO log4j.logger.com.gs.sitecore.common.caching = DEBUG, CACHE log4j.logger.org.displaytag = WARN ######################## # Console Appender ######################## log4j.appender.CONSOLE2=org.apache.log4j.ConsoleAppender log4j.appender.CONSOLE2.Target=System.out log4j.appender.CONSOLE2.Threshold=DEBUG log4j.appender.CONSOLE2.layout=org.apache.log4j.PatternLayout log4j.appender.CONSOLE2.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}] %c{1}.%t - %-6p - %m%n
ERROR: invalid console appender config detected, console stream is looping.
解决方法一是不用Console的Appender,或者改jboss的配置
文件,在jboss-service.xml文件里,把
<mbean code="org.jboss.logging.Log4jService" name="jboss.system:type=Log4jService,service=Logging">
<attribute name="ConfigurationURL">resource:log4j.xml</attribute>
<attribute name="CatchSystemOut">false</attribute>
<attribute name="Log4jQuietMode">true</attribute>
</mbean>。