需要在web应用的WEB-INF目录下添加jboss-deployment-structure.xml文件,这里面配置jboss部署时要自定义的内容。咱们要配置以下内容。

<?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已经引入的日志门面模块直接屏蔽掉。

相关文章:

  • 2021-11-16
  • 2021-08-08
  • 2021-07-08
  • 2022-12-23
  • 2022-02-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
  • 2021-11-01
  • 2021-07-10
  • 2021-08-18
  • 2021-04-28
相关资源
相似解决方案