Getting logback and slf4j to work in JBoss AS 7
As usual, it has to do with classloading and that JBoss internally also uses slf4j and logback. As everyone seems to state just about everywhere, JBoss classloading has completely changed in AS 7. Here's the recipe for this particular problem.
Create a file called "jboss-deployment-structure.xml" in the META-INF directory for an EAR or WEB-INF directory for a WAR. This file can contain a lot of different stuff to tweak the classloader, but for the logback case this is enough:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<exclusions>
<module name="org.apache.commons.logging" />
<module name="org.apache.log4j" />
<module name="org.jboss.logging" />
<module name="org.jboss.logging.jul-to-slf4j-stub" />
<module name="org.jboss.logmanager" />
<module name="org.jboss.logmanager.log4j" />
<module name="org.slf4j" />
<module name="org.slf4j.impl" />
</exclusions>
</deployment>
</jboss-deployment-structure>
For the EAR case, you'll probably need to add a subdeployment for each application (both wars and ejbs) with the same exclusions. For more details, consult the JBoss documentation on the subject.
UPDATE
I ran into the same issue with log4j2 on EAP 6.3 and the recipe still works. It is important to add a separate exclusion for each sub-deployment or JBoss will eat your log messages and they'll go into the JBoss internal logger.
Getting logback and slf4j to work in JBoss AS 7的更多相关文章
- logback:logback和slf4j中的:appender、logger、encoder、layout
(1)appender 1.appender标签是logback配置文件中重要的组件之一.在logback配置文件中使用appender标签进行定义.可 以包含0个或多个appender标签. 2.a ...
- log4j 、logback 以及slf4j三者之间的关系
在项目的开发中由于对于log4j.logback以及slf4j之间的关系和相关的知识不能清晰掌握,在业余时间进行记录. 1.三者之间的关系 1) 简答的讲就是slf4j是一系列的日志接口,而log4j ...
- Logback,SLF4J,Log4J2。了解它们并学习如何使用。(翻译)
背景 如果您正在或在任何Java项目上工作,则可能已记录了一些debug,error或info语句以进行调试或跟踪.通过将库记录到磁盘或其他某种介质上的文件中来写这些语句. 日志记录是任何项目的关键方 ...
- logback和slf4j的使用之logger使用
原文:https://blog.csdn.net/cw_hello1/article/details/51923814 一.logger标签描述:(了解logger标签之前先看看两个重要概念) 1.主 ...
- logback + slf4j + jboss + spring mvc
logback.log4j.log4j2 全是以同一个人为首的团伙搞出来的(日志专业户!),这几个各有所长,log4j性能相对最差,log4j2性能不错,但是目前跟mybatis有些犯冲(log4j2 ...
- lombok+slf4j+logback SLF4J和Logback日志框架详解
maven 包依赖 <dependency> <groupId>org.projectlombok</groupId> <artifactId>lomb ...
- How to setup SLF4J and LOGBack in a web app - fast--转载
原文:https://wiki.base22.com/display/btg/How+to+setup+SLF4J+and+LOGBack+in+a+web+app+-+fast Logback is ...
- 使用 SLF4J + LogBack 构建日志系统(转)
转载自:http://www.cnblogs.com/mailingfeng/p/3499436.html 上次我们讨论了如何选择一个好的开源日志系统方案,其中的结论是:使用 SLF4J + LogB ...
- 从源码来理解slf4j的绑定,以及logback对配置文件的加载
项目中的日志系统使用的是slf4j + logback.slf4j作为一个简单日志门面,为各种loging APIs(像java.util.logging, logback, log4j)提供一个简单 ...
随机推荐
- numpy技巧
矩阵旋转: mat_array = np.array([[1,2],[4,3]]) rotate_90 = np.zeros((2,2), np.uint8) rotate_180 = np.zero ...
- django1.11入门
快速安装指南¶ 在使用Django之前,您需要安装它.我们有 完整的安装指南,涵盖所有可能性; 本指南将指导您进行简单,最小化的安装,在您完成介绍时可以正常工作. 安装Python¶ 作为一个Pyth ...
- 【Docker】第一篇 Docker的初始化安装部署
一.Docker基础 Dacker倡导的理念:一个容器一个进程 Docker的版本了解: Docker从1.13版本之后采用时间线的方式作为版本号,分为社区版CE和企业版EE. 社区版是免费提供给个人 ...
- POJ 3468 A Simple Problem with Integers(分块入门)
题目链接:http://poj.org/problem?id=3468 A Simple Problem with Integers Time Limit: 5000MS Memory Limit ...
- git查看添加删除远程仓库
查看远程仓库 git remote -v 删除远程仓库 git remote remove origin 添加远程仓库 git remote add origin 仓库地址 关联远程分支 重新关联远程 ...
- 测试效率 timeit cProfile
timeit使用 def f1(lIn): l1 = sorted(lIn) # O(nlogn) C语言的 l2 = [i for i in l1 if i<0.5] # O(n) retur ...
- Spring的Controller映射规则
URL映射 1) 一般格式@RequestMapping(value=“/test”) 2) 可以使用模板模式映射,@RequestMapping(value=“/test/{userId}”) 3) ...
- arcgis for android apk太大
原来大概都要20多M, 太大的原来是.so文件 arcgis for android api里面有armeabi armeabi-v7a x86的 每个so都接近10m 要是都保留就20多m了 由于 ...
- ThoughtWorks.QRCode类库
ThoughtWorks.QRCode一个二维码生成类库.
- SQL之联合查询学习笔记
定义: 联合查询可合并多个相似的选择查询的结果集.等同于将一个表追加到另一个表,从而实现将两个表的查询组合到一起,使用谓词为UNION或UNION ALL. 语法格式 UNION 可以将两个或两个以上 ...