Disable JBoss 5 logging to the console

老子叫甜甜 提交于 2019-12-11 01:30:07

问题


I still have to deal with JBoss 5 where I want to disable the logging to the console. I found in jboss-log4j.xml the appender "CONSOLE".

<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
  <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
  <param name="Target" value="System.out"/>
  <param name="Threshold" value="FATAL"/>
  <layout class="org.apache.log4j.PatternLayout">
     <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
  </layout>
</appender>

If I delete the appender JBoss throw an error but I found these solutions:

1.Delete one line:

param name="Target" value="System.out"

2.Set logging level:

param name="Threshold" value="FATAL"

But I am not so happy with theses solutions, because I do not know if there are any side effects (solution 1. is in my eyes critical) Is there a "better" solution?

Greetings

Update

It is possible to remove the appender

<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> ... </appender>

I only forgot to update the root category. here is a reference to the CONSOLE appender which should be also removed Delete this:

<appender-ref ref="CONSOLE"/>

After I removed it no error occur and also no logging to the console.

来源:https://stackoverflow.com/questions/38077015/disable-jboss-5-logging-to-the-console

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!