How to configure multiple log4j appenders in JBoss
Issue
- How can I configure multiple log4j appenders in JBoss?
- We need two logging appenders, both time/date based rolling one and size based rolling one. Though I modified
conf/jboss-log4j.xml
like the following, I do not seeserver_size.log
but onlyserver-daily.log
.
<appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
<param name="File" value="${jboss.server.log.dir}/server_daily.log"/>
...
</appender>
<appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
<param name="File" value="${jboss.server.log.dir}/server_size.log"/>
...
</appender>
<appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<appender-ref ref="FILE"/>
...
</appender>
Environment
-
Red Hat JBoss Enterprise Application Platform (EAP)
- 4.2
- 4.3
- 5.x
-
Red Hat JBoss Enterprise SOA Platform (SOA-P)
- 4.2
- 4.3
- 5.x
-
Red Hat JBoss Enterprise WEB Platform (EWP)
- 5.x
-
Log4j
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.