1

I have a web app that I am trying to migrate to JBoss EAP 6.1. I have tried every suggestion on SO to accomplish log4j logging and I just can't seem to get any traction. The server logs don't get logged to nor does the Eclipse console get logged to using the log4j statements. I have even tried System.out statements and they don't work. The Web app is up and running and I do get logs for the startup of JBoss.

What I have tried

  • Moving log4j.xml to WEB-INF
  • Moving log4j.xml to src/main/java so that it gets bundled in the classes folder
  • Creating a jboss-deployment-structure.xml and placing it in the META-INF folder
  • Changing the logging library to org.jboss.jboss.logging.Logger
  • Adding JAVA_OPTS="$JAVA_OPTS -Dorg.jboss.as.logging.per-deployment=false" to the standalone.conf file

Posts that I have referenced:

  1. Link 1
  2. Link 2
  3. Link 3
  4. Link 4

This seems like such a simple thing, yet I am at a total loss. My next step is to forget about the web app and just make a little test app and see if I can get that logging. Maybe its a conflict or something somewhere. Anyhow, any help would be greatly appreciated. Thanks.

EDIT 1 log4j.xml Contents for James

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE log4j:configuration SYSTEM "log4j.dtd" >
    <log4j:configuration>
<appender name="stdout" class="org.apache.log4j.ConsoleAppender">
    <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" value="%d{ABSOLUTE} %5p %c{1}:%L - %m%n"/>
    </layout>
</appender>


<appender name="dailyRollingFileAppender" class="org.apache.log4j.DailyRollingFileAppender">
    <param name="File" value="/logs/voice/config/configDbLog.log"/>

    <!-- C:\\tmp\configDblog.txt -->

    <param name="Append" value="true"/>
    <param name="DatePattern" value="'.'yyyy-MM-dd"/>
    <layout class="org.apache.log4j.PatternLayout">
    <!--param name="ConversionPattern" value="%d [%t] %p - %m%n"/-->
    <param name="ConversionPattern" value="%d{ABSOLUTE} %5p %c{1}:%L - %m%n"/>
    </layout>
</appender>

 <logger name="E1Audit">
    <level value="WARN"/>
    <appender-ref ref="stdout"/>
</logger>

<root>
    <priority value="TRACE"/>
    <appender-ref ref="dailyRollingFileAppender"/>
    <appender-ref ref="stdout"/>
</root>

</log4j:configuration>
Community
  • 1
  • 1
Hodglem
  • 614
  • 9
  • 17

1 Answers1

0

Removing the log4j.xml completley got the app logging. I guess it was a conflict since the log4j.xml was in the classpath?

Hodglem
  • 614
  • 9
  • 17
  • It's tough to say. There were some issues with per-deployment logging which may have not been all sorted out until JBoss EAP 6.3. I don't recall the details off the top of my head though. – James R. Perkins Apr 22 '16 at 16:57