javaloggingwildfly-9subsystem

Wildfly disabling logging subsystem


in my web application i need to use my logging framework. The framework is loaded by each webapplication like a jar dependency.

In order to disable jboss logging subsystem i tried to create a

jboss-deployment-structure.xml

file copied in:

(firt try)- webapplication.war\WEB-INF\
(second try) - webapplication.war\WEB-INF\lib\my_framework.jar\META-INF\

the content of the file is:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
    <deployment>
        <exclusions>
            <module name="org.jboss.as.logging (or org.jboss.logging)" /> 
        </exclusions>
    </deployment>

But nothing seems to change in the log process. I checked the framework MANIFEST.MF and no other dependencies are imported.

I also realized that by cancelling the logging subsystem from standalone.xml the custom logging framework works fine.


Solution

  • You can exclude subsystems from deployments with in the jboss-deployment-structure.xml as well. Excluding the module does not exclude the subsystem from processing the deployment.

    <?xml version="1.0" encoding="UTF-8"?>
    <jboss-deployment-structure>
        <deployment>
            <exclude-subsystems>
                <subsystem name="logging" />
            </exclude-subsystems>
        </deployment>
    </jboss-deployment-structure>
    

    Excluding the subsystem will stop the deployment from being processed by the subsystem.