JBoss doesn't output logs since Log4j XML config file is not properly configured

Solution In Progress - Updated -

Issue

We currently installed JBossEAP6.1 on RHEL6.4. It won't output any logs whom path is configured in log4j.xml even though we configured "log4j.config.filepath" parameter in standalone.xml.

We added the following lines to direct where log4j.xml file is stored.
standalone.xml

<system-properties>
    <property name="log4j.config.filepath" value="/prod/etc/log4j.xml" />
</system-properties>

log4j.xml

  <appender name="APLOGFILE" class="org.apache.log4j.RollingFileAppender">
    <param name="Encoding" value="UTF-8" />
    <param name="File" value="${jboss.server.base.dir}/log/Application/Application_abc011.log" />
    <param name="MaxFileSize" value="5MB"/>
    <param name="MaxBackupIndex" value="50" />
    <param name="Append" value="true" />
    <layout class="com.xxx.xxx.xxx.log4j.StdLogPatternLayout">
      <param name="ConversionPattern" value="%d|%-5p|RID:%R|UID:%u|%c{1}|(%F:%L)|%m%n"/>
    </layout>
  </appender>
  <root>
    <appender-ref ref="APLOGFILE" />
  </root>

We confirmed that some java test codes works as we can see it outputs logs for each log level, only if we simply change a file path of default parameters in standalone.xml without log4j.xml.
standalone.xml

<subsystem xmlns="urn:jboss:domain:logging:1.2">
    <file-handler name="FILE" autoflush="true">
        <formatter>
            <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
        </formatter>
        <file relative-to="jboss.server.log.dir" path="server_abc011.log"/>
        <append value="true"/>
        <level name="WARN"/>
    </file-handler>

[Q] Would you kindly advise us how we can configure log4j.xml properly in order to output logs via log4j.xml?

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 6.1.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.