0 Replies Latest reply on Oct 25, 2016 9:08 AM by Cheng Fang

    How do I enable debug logging

    Cheng Fang Master

      The following Weld FAQ describes how to configure jboss-logging levels in Java SE applications.  Since JBeret uses jboss-logging and Weld SE, this FAQ also applies to JBeret in Java SE.


      Weld: Documentation

      How do I enable debug logging for Weld SE?

      In Weld 2.1 SLF4J was replaced with JBoss Logging which provides support for the internationalization and localization of log messages and exception messages. However, JBoss Logging itself does not write any log messages. Instead, it only constructs a log message and delegates to one of the supported logging frameworks. And so if you want to enable the debug logging for Weld SE, you’ll have to identify and configure the underlying logging framework.

      Which logging framework writes data?

      The supported "back-end" frameworks include:

      1. jboss-logmanager
      2. Log4j
      3. SLF4J
      4. JDK logging

      A system property org.jboss.logging.provider may be used to specify the logging framework directly. Supported values are jboss, jdk, log4j and slf4j. If this system property is not set, JBoss Logging will attempt to find the logging frameworks from the above-mentioned list on the classpath - the first one found is taken.

      Simple way for testing purposes

      If you just want to see the debug log messages as quickly as possible try to add org.slf4j:slf4j-simple on the classpath, set the "back-end" framwork to slf4j and change the level for org.jboss.weld, e.g.:




      mvn clean test -Dtest=MyWeldSETest -Dorg.jboss.logging.provider=slf4j -Dorg.slf4j.simpleLogger.log.org.jboss.weld=debug