8 Replies Latest reply on Sep 7, 2016 6:06 PM by simranjeetsingh1786

    Using LogBack but per WAR configuration on WildFly 9

    rdul064

      Hi All,

       

      I try to accomplish the following

      - Use Logback for logging (and no I can't use SLF4J, requirement of client)

      - logging configuration per WAR can be specified

      - I have multiple WAR file deployments on the server

      - Using WildFly 9.

       

      What I did

      - I created an implementation of ch.qos.logback.classic.spi.Configurator which is able to load configuration for a WAR file.

      - I excluded the logging subsystem (using jboss-deployment-structure file)

      <jboss-deployment-structure>
      
          <deployment>
      
              <exclude-subsystems>
                  <subsystem name="logging"/>
              </exclude-subsystems>
          </deployment>
      </jboss-deployment-structure>
      
      
      

      - Everything works fine when using only a single WAR file

       

      The issue is that log messages which are logged by 'modules' like JPA/Hibernate, can end up in any log file. There seems an issue to remember which application/WAR initiated the Thread and thus who needs to be responsible for writing the log.

       

      Thanks for your insight into this issue.

       

      Best regards

      Rudy