SLF4J logger.debug()没有登录JBoss 6 [英] SLF4J logger.debug() does not get logged in JBoss 6

查看:111
本文介绍了SLF4J logger.debug()没有登录JBoss 6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上下文: JBoss Application Server 6

Context: JBoss Application Server 6

我依赖 slf4j-jboss-logmanager.jar 将slf4j绑定到JBoss日志管理器。

I am relying on slf4j-jboss-logmanager.jar to bind slf4j to the JBoss log manager.

所有 logger.info()输出为正确记录

然而, logger.debug()输出从不在日志流中出现

即使jboss-logging.xml已将级别设置为 DEBUG 对于CONSOLE记录器...

Even though jboss-logging.xml has set the level to DEBUG for the CONSOLE logger...

   <console-handler name="CONSOLE" autoflush="true" target="System.out">
      ...
      <level name="DEBUG"/>
      ...
   </console-handler>

有人知道为什么我的调试细节永远不会到达日志流吗?

Does anybody see why my debug details never reach the log stream?

推荐答案

从JBoss 6开始,日志管理器和jboss-logging.xml是专有的。

As from JBoss 6, the log manager and jboss-logging.xml are proprietary.

key位于配置文件末尾的root-logger定义中:

The key is in the root-logger definition at the end of the config file:

默认定义将所有输出限制为<$> <$ strong> <$> c $ c> INFO 级别:

   <root-logger>
      <level name="${jboss.server.log.threshold:INFO}"/>
      <handlers>
         <handler-ref name="CONSOLE"/>
         <handler-ref name="ERROR"/>
         <handler-ref name="FILE"/>
      </handlers>
   </root-logger>

将此更改为

   <root-logger>
      <level name="${jboss.server.log.threshold:DEBUG}"/>
      <handlers>

打开所有可能的DEBUG信息的大门。

opens the gate for all possible DEBUG information.

可能有太多的DEBUG信息。因此,我必须添加一些额外的过滤器:

Probably too much DEBUG information. Therefore, I had to add some additional filters:

   <logger category="org.jboss">
      <level name="INFO"/>
   </logger>

   <logger category="org.hibernate">
      <level name="INFO"/>
   </logger>

   <logger category="javax">
      <level name="INFO"/>
   </logger>

   <logger category="idealconnector">
      <level name="INFO"/>
   </logger>

   <logger category="httpclient">
      <level name="INFO"/>
   </logger>

   <logger category="my.package">
      <level name="DEBUG"/>
   </logger>

这篇关于SLF4J logger.debug()没有登录JBoss 6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆