Disable JBoss 5 logging to the console

2019-07-13 07:54发布

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.

标签: java jboss log4j
0条回答
登录 后发表回答