2 Replies Latest reply on Apr 27, 2016 5:24 AM by Avor Nadal

    Logging profiles: exceptions thrown in an EAR module aren't being logged. Why?

    Avor Nadal Newbie

      Hello:

       

      I'm using Wildfly 10 in Ubuntu 14.04. I've created a logging profile in the "standalone.xml" configuration file. I've done this so that the logging messages generated by my EAR module, or by any library used in it, are written to a file separate from "server.log". I've been able to play with the INFO and DEBUG levels, and it has worked fine.

       

      However, I've a problem with the messages of the ERROR level, specially those that are generated when an exception occurs. They are always written to "server.log", no matter how I configure my logging profile. The level of the root logger in my profile is set to INFO, so the messages in the ERROR level should be written. But they aren't. Is it the expected behaviour? Is it a bug? Am I doing something wrong?

       

      My logging profile looks this way:

       

      <logging-profile name="my-application">
              <periodic-rotating-file-handler name="FILE" autoflush="true">
                  <formatter>
                      <named-formatter name="PATTERN"/>
                  </formatter>
                  <file relative-to="jboss.server.log.dir" path="my-application.log"/>
                  <suffix value=".yyyy-MM-dd"/>
                  <append value="true"/>
              </periodic-rotating-file-handler>
              <root-logger>
                  <level name="INFO"/>
                  <handlers>
                      <handler name="FILE"/>
                  </handlers>
              </root-logger>
              <formatter name="PATTERN">
                      <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p (%t) [%c] %s%e%n"/>
              </formatter>
      </logging-profile>
      
      
      
      

       

      It doesn't matter whether the exception is thrown in the EJB module or the WEB module. All the ERROR messages "escape" from my profile.

       

      Thank you.