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>
4

2 回答 2

0

一种解决方法(DEBUG msgs include INFO msgs)

在根记录器中拦截所有 DEBUG msgs
放置一个将它们重定向到文件
的处理程序 放置一个将它们重定向到控制台
的处理程序 在第二个处理程序的定义中,指定级别 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>
于 2019-07-02T09:16:25.350 回答
0

如果您只是希望调试消息最终出现在控制台上,您只需将级别更改为DEBUG. 使用 CLI,您将执行;

/subsystem=logging/root-logger=ROOT:write-attribute(name=level, value=DEBUG)
/subsystem=logging/console-handler:write-attribute(name=level, value=DEBUG)
于 2019-06-26T20:42:56.810 回答