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.xmllike the following, I do not seeserver_size.logbut 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 of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
