How to configure multiple log4j appenders in JBoss

Solution Verified - Updated -

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 see server_size.log but only server-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.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content