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

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

问题描述

上下文: JBoss 应用服务器 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() 输出从未出现在日志流中.

However, logger.debug() output never appears in the log stream.

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

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.

密钥在配置文件末尾的 root-logger 定义中:

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

默认定义将所有输出限制为INFO级别的任何处理程序:

The default defintion caps all output to whatever hander at INFO level:

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

为所有可能的调试信息打开大门.

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天全站免登陆