0 Replies Latest reply on Oct 19, 2016 9:25 AM by jozefk

    Jboss 7.1.1 issue with using log4j as module

    jozefk

      Hello,

       

      I have an issue with log4j logging on Jboss 7.1.1 final.

       

      Situation is following:

      1. Log4j config file is used to set custom appender and location of log file

      2. Log files are extracted from WAR file (external logging)

      3. Log4j and some other dependencies are being used as modules  (in case I don't use modules, logging is working properly)

      4. I used following jboss-deployment-structure:

       

      <jboss-deployment-structure>
          <deployment>
              <dependencies>
                  <!-- <module name="org.apache.commons.logging" /> <module name="org.apache.log4j"
                      /> <module name="org.hibernate" /> -->
                  <!-- <module name="de.mylog" meta-inf="export" export="true" services="export">
                      <imports> <include path="META-INF**" /> <include path="org**" /> </imports>
                      </module> -->
                  <module name="org.springframework" meta-inf="export" export="true"
                      services="export">
                      <imports>
                          <include path="META-INF**" />
                          <include path="org**" />
                      </imports>
                  </module>
                  <module name="cx.work" />

              </dependencies>
              <!-- Exclusions allow you to prevent the server from automatically adding
                  some dependencies -->
              <exclusions>
                  <module name="org.apache.commons.logging" />
                  <module name="org.slf4j" />
                  <module name="org.slf4j.ext" />
                  <module name="org.slf4j.impl" />
                  <module name="org.apache.log4j" />
              </exclusions>

          </deployment>
      </jboss-deployment-structure

       

      --------------------------------------------------------------------------------------------

      Log4j jar is copied to module cx.work.

       

      Consequently, all log information is written in jboss server.log instead of my custom log, which is empty.

       

      How to solve this issue in order to have logging written exclusively in custom log file?

       

      Thank you in advance,

      Jozef