須要在web應用的WEB-INF目錄下添加jboss-deployment-structure.xml文件,這裏面配置jboss部署時要自定義的內容。我們要配置如下內容。web
<?xml version="1.0" encoding="UTF-8"?> <jboss-deployment-structure> <deployment> <!-- Exclusions allow you to prevent the server from automatically adding some dependencies --> <exclusions> <module name="org.slf4j" /> <module name="org.slf4j.impl" /> <!-- 若是項目中用到jcl-over-slf4j,能夠將下面這個module也斃了 --> <module name="org.slf4j.jcl-over-slf4j" /> </exclusions> </deployment> </jboss-deployment-structure>
緣由是jboss內已經引用了slf4j,且版本號極可能跟我們項目中用到的版本號不同,且與logback版本兼容有問題。那我們的日誌文件就生不成了。以上配置將這些jboss已經引入的日誌門面模塊直接屏蔽掉。spa