3

In my web application i developed my custom logging framework based on slf4j and log4j2.

The application is been deployed on Jobss WildFly 9. The problem is that Wildfly continues to use its

<module xmlns="urn:jboss:module:1.3" name="org.slf4j.impl">

everytime i want to log instead of my framework.

This is the web application tree:

webApplication
|
|_ WEB-INF
      |_jboss-deployment-structure.xml

I tried to write the deployment descriptor in this way:

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

and these are the dependencies carried with the framework:

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.7</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-slf4j-impl</artifactId>
        <version>2.6</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>2.6</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>2.6</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-web</artifactId>
        <version>2.6</version>
    </dependency>

But this doesn't seem to work.

Alex
  • 1,515
  • 2
  • 22
  • 44
  • FWIW if you're excluding the logging subsystem the other exclusions aren't needed. By "But this doesn't seem to work" what do you mean? What do you expect to happen vs what is happening? For example are your application logs not obeying your log manager configuration? – James R. Perkins Jun 20 '16 at 16:32

1 Answers1

0

I realized there was a dependency inserted inside the web appication manifest pointing to the org.slf4j jboss module

Alex
  • 1,515
  • 2
  • 22
  • 44