Unable to exclude logmanager module on JBoss 6 EAP

依然范特西╮ 提交于 2019-12-11 05:15:07

问题


I'm trying to exclude all the logging modules from a jboss-deployment-structure.xml in JBoss 6 EAP.

My jboss-deployment-structure.xml is:

<jboss-deployment-structure>
  <deployment>
    <exclusions>
      <module name="org.apache.log4j" />
      <module name="org.jboss.logging" />
      <module name="org.jboss.logmanager" />
      <module name="org.jboss.log4j.logmanager" />
    </exclusions>
  </deployment>
</jboss-deployment-structure>

So after I deploy my .war with said configuration I get:

[ModuleClassLoader for Module "org.jboss.log4j.logmanager:main" from local module loader @10ab323 (roots: /home/me/dev/jboss-eap-6.0/modules)] whereas object of type "org.apache.log4j.ConsoleAppender" was loaded by [ModuleClassLoader for Module "deployment.myapp.war:main" from Service Module Loader].

So I generally want to make JBoss stop trying to load log4j and let my application load it.

Is it at all possible to disable the logmanager module ?

Thanks,


回答1:


I was able to resolve this problem using this jboss-deployment-structure.xml

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
    <exclusions>
        <module name="org.apache.log4j"/>
        <module name="org.apache.commons.logging"/>
    </exclusions>
</deployment>

Which I have created under WEB-INF. You should also put your log4j.jar in WEB-INF/lib.



来源:https://stackoverflow.com/questions/12674062/unable-to-exclude-logmanager-module-on-jboss-6-eap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!