0

I'd like to log every single debug messages into some file by adding some logger in standalone.xml.

The app is runnning on jboss 7 . How can I do so ?

P.S. : I already have a root logger to output INFO level things to console.I tried to add a second one but it seems that it's not allowed.

<root-logger>
      <level name="INFO"/>
      <handlers>
          <handler name="CONSOLE"/>
      </handlers>
</root-logger>
loser8
  • 362
  • 3
  • 14

2 Answers2

0

If you simply want debug messages to end up on the console you just need to change the level to DEBUG. With CLI you'd execute;

/subsystem=logging/root-logger=ROOT:write-attribute(name=level, value=DEBUG)
/subsystem=logging/console-handler:write-attribute(name=level, value=DEBUG)
James R. Perkins
  • 16,800
  • 44
  • 60
0

One workaround (DEBUG msgs include INFO msgs)

Intercept all DEBUG msgs in the root logger
Put a handler that redirects them to a file
Put a handler that redirects them to the console
In the definition of the second handler , specify the level INFO

<root-logger>
  <level name="DEBUG"/>
  <handlers> 
         <handler name="CONSOLE"/>
         <handler name="FILE"/>
  </handlers>
<root-logger>

<console-handler name="CONSOLE">
  <level name="INFO"/>
    <formatter>
      <named-formatter name="SIMPLE-PATTERN"/>
    </formatter>
</console-handler>
loser8
  • 362
  • 3
  • 14