1 Reply Latest reply on Nov 28, 2014 4:38 AM by giofyxle

    Jboss-Logging does not write Logs when Resource Adapter is linked to log4.jar

    giofyxle

      We deploy a web-application and an resource-adapter to WildFly 8.1.

      Both web-application and resource-adapter use some same libraries. These libs are deployed to WildFly as a global module. This module includes a log4j.jar.

      In the source-code of those common libraries, of the web-application and of the resource-adapter we call functions of log4j.

      With this architecture the web-application works but we have problems to get our own log-output.

       

      In the logging subsystem we configure to write our own logs “de.mycompany” to a special file. This file is generated but remains empty.

       

      Then I removed the log4j.jar from our global module. Now the resource-adapter cannot be deployed but the web-application is deployed. And when calling the web-application, our own logs are written to that special file. (But of course the application cannot work fully without the resource-adapter)

       

      In the logging subsystem we put

      use-deployment-logging-config to false

      and

      add-logging-api-dependencies to true

       

      My questions:

      1. Is it wrong to put log4j.jar to a global module?
      2. If yes: How can I make the resource-adapter run without log4j.jar in the global module?
      3. If no: What to do to have the log-output written?

       

      Thanks Gio

        • 1. Re: Jboss-Logging does not write Logs when Resource Adapter is linked to log4.jar
          giofyxle

          So I found out:

           

          to be able to use jboss-logging we must not use our own log4j.jar.

          The solution was to remove the log4.jar from our global module. Instead we referenced in the global module the wildfly intern log4j-module:

           

          <module xmlns="urn:jboss:module:1.3" name="de.safir.api">

              <dependencies>

                    ....

                   <module name="org.apache.log4j"/>

              </dependencies>

          .....

          </module>


          In this configuration the resource-adapter starts without error and the jboss logging works.