0 Replies Latest reply on Aug 16, 2011 2:29 PM by mindchild

    AS7 + SLF4J + MDC

    mindchild

      Is it possible to use a MDC Bean with SLF4J and Jboss Logmanager?

       

      We use SLF4J to log and it works beautifully as soon as I put this to standalone.xml:

       

      <subsystem xmlns="urn:jboss:domain:ee:1.0">

          <global-modules>

              <module name="org.slf4j.impl" slot="main"/>

          </global-modules>

      </subsystem>

       

      But when I try to use the MDC Bean (org.slf4j.MDC) i.e.

       

      MDC.remove("MSG");

       

      I get this error:

       

      20:25:22,295 SEVERE [javax.faces.event] (http--127.0.0.1-8080-1) java.lang.NoClassDefFoundError: Could not initialize class org.slf4j.MDC

       

      SLF4J docu says, only log4j and logback are capable of MDC, but in slf4j-jboss-logmanager-1.0.0.GA.jar (from org.slf4j.impl Module) I see org\slf4j\impl\StaticMDCBinder.class .

       

      Is there a way to make this work: AS7 + SLF4J + Jboss Logging + MDC

       

      Thank you very much in advance!