如何在JBoss6 AS中“激活" SLF4J日志记录 [英] How to 'activate' SLF4J logging in JBoss6 AS

查看:104
本文介绍了如何在JBoss6 AS中“激活" SLF4J日志记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给出:

JBoss 6应用服务器M3

$ ls -la $JBOSS_HOME/common/lib/slf4j-*
-rwx------+ common/lib/slf4j-api.jar
-rwx------+ common/lib/slf4j-jboss-logmanager.jar

我相信上述库提供了SLF4J和JBoss日志记录系统之间的桥梁.

我的Web应用程序依靠SLF4J进行日志记录.不过,我没有在WAR中打包任何slf4j库.

$ jar tvf proj-web/target/proj.war | grep slf4
$

(如果我包括它们,没有任何区别)

我的jboss-logging.xml已将CONSOLE处理程序的级别设置为DEBUG

$ more server/default/deploy/jboss-logging.xml
...
   <console-handler name="CONSOLE" autoflush="true" target="System.out">
      <error-manager>
         <only-once/>
      </error-manager>
      <level name="DEBUG"/>

问题:

我忘记了将日志记录输出到JBoss日志记录系统中的什么?我什至看不到他尝试 绑定 JBoss Logging系统 SLF4J 的轨迹. >

===== [更新] =====

确实有效 !! (无需进一步配置)

我刚刚将代码从logger.debug("abc")更改为logger.info("xyz"),现在我有了日志输出.

=>因此,看来我根本无法正确获取日志级别的过滤... [待续]

解决方案

我终于找到了更新问题的答案.

因为它与原始问题有很大不同,所以我打开了一个新项目:

SLF4J logger.debug()无法获取登录到JBoss 6

Given:

JBoss 6 Application Server M3

$ ls -la $JBOSS_HOME/common/lib/slf4j-*
-rwx------+ common/lib/slf4j-api.jar
-rwx------+ common/lib/slf4j-jboss-logmanager.jar

I believe that the above libs provide the bridge between SLF4J and the JBoss Logging system.

My Web application relies on SLF4J for logging. Though, I don't package any slf4j libs with my WAR.

$ jar tvf proj-web/target/proj.war | grep slf4
$

(If I include them, doesn't make any difference)

My jboss-logging.xml has set the level for the CONSOLE handler to DEBUG

$ more server/default/deploy/jboss-logging.xml
...
   <console-handler name="CONSOLE" autoflush="true" target="System.out">
      <error-manager>
         <only-once/>
      </error-manager>
      <level name="DEBUG"/>

Question:

What did I forget to get my logging output into the JBoss logging system? I don't even see a TRACE that he tries to bind the JBoss Logging system to SLF4J.

=====[ UPDATE ]=====

It does actually work!! (without further configuration)

I just changed my code from logger.debug("abc") to logger.info("xyz") and now i do have logging output.

=> So it looks like I'm simply not able to get get log-level filtering right... [to be continued]

解决方案

I finally found the answer to my updated question.

As it is so different from the original question, I've opened a new item:

SLF4J logger.debug() does not get logged in JBoss 6

这篇关于如何在JBoss6 AS中“激活" SLF4J日志记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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