5 Replies Latest reply on May 14, 2013 1:27 PM by James Perkins

    jboss-as-7.1.0.Final Stack Trace not being logged from SLF4J

    Eric Stein Newbie

      I'm having very little sucess getting JBoss to correctly log the stack trace of my error messages. Our application uses SLF4J, which is in our WAR file (slf4j-api-1.7.5.jar). This prints stack trace:

           LOGGER.error("Something blew up", e);

      This does not print stack trace:

           final String verb = "blew";

           LOGGER.error("Something {} up", verb, e);

      What is going on? How do I get JBoss to work correctly with SLF4J?

      Thanks,

      Eric Stein

      standalone.xml:

      <subsystem xmlns="urn:jboss:domain:logging:1.1">

        <console-handler name="CONSOLE">

          <level name="DEBUG"/>

          <formatter>

            <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>

          </formatter>

        </console-handler>

        <periodic-rotating-file-handler name="FILE">

          <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.log"/>

          <suffix value=".yyyy-MM-dd"/>

          <append value="true"/>

        </periodic-rotating-file-handler>

        <logger category="com.arjuna">

          <level name="WARN"/>

        </logger>

        <logger category="org.apache.tomcat.util.modeler">

          <level name="WARN"/>

        </logger>

        <logger category="sun.rmi">

          <level name="WARN"/>

        </logger>

        <logger category="jacorb">

          <level name="WARN"/>

        </logger>

        <logger category="jacorb.config">

          <level name="WARN"/>

        </logger>

        <logger category="org.jboss.resteasy">

          <level name="ALL"/>

        </logger>

        <logger category="com.mycompany">

          <level name="ALL"/>

        </logger>

        <root-logger>

          <level name="WARN"/>

          <handlers>

            <handler name="CONSOLE"/>

            <handler name="FILE"/>

          </handlers>

        </root-logger>

      </subsystem>