-In Weld 2.1 [SLF4J](https://www.slf4j.org) was replaced with [JBoss Logging](https://developer.jboss.org/wiki/JBossLoggingTooling) 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.
+Weld uses [JBoss Logging](https://github.com/jboss-logging/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. If no framework is explicitly configured, JBoss Logging auto-discovers one from the classpath in the following order:
-**Which logging framework writes data?**
+1. JBoss LogManager (used inside WildFly)
+2. [Log4j2](https://logging.apache.org/log4j/2.x/)
+3. [Logback](https://logback.qos.ch/) (via SLF4J)
+4. JDK logging (fallback)
-The supported "back-end" frameworks include:
+You can force a specific framework using the system property `org.jboss.logging.provider` with values `jboss`, `log4j2`, `slf4j`, or `jdk`.
-1. [jboss-logmanager](https://developer.jboss.org/wiki/StandaloneJBossLogManager)
-2. [Log4j](https://logging.apache.org/log4j/2.x/)
-3. [SLF4J](https://www.slf4j.org/)
-4. JDK logging
+#### SLF4J / Logback
-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.
+[SLF4J](https://www.slf4j.org/) is a logging facade and [Logback](https://logback.qos.ch/) is its native implementation. JBoss Logging auto-discovers SLF4J when Logback is on the classpath. Add `ch.qos.logback:logback-classic` to the classpath and configure `logback.xml`:
+
+```xml
+
+
+
+```
-**Simple way for testing purposes**
+#### Log4j2
-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" framework to `slf4j` and change the level for `org.jboss.weld`, e.g.:
+Add `org.apache.logging.log4j:log4j-core` to the classpath and configure `log4j2.xml`:
```xml
-
- org.slf4j
- slf4j-simple
- 1.7.2
- test
-
+
+
+
+```
+
+#### JDK logging
+
+No extra dependencies needed. Set the level in `logging.properties`:
+
+```
+org.jboss.weld.level=FINE
+handlers=java.util.logging.ConsoleHandler
+java.util.logging.ConsoleHandler.level=FINE
```
+#### Quick setup for testing
+
+If you just want to see debug messages as quickly as possible, add `org.slf4j:slf4j-simple` to the classpath and run with:
+
```
mvn clean test -Dtest=MyWeldSETest -Dorg.jboss.logging.provider=slf4j -Dorg.slf4j.simpleLogger.log.org.jboss.weld=debug
```
+Note that `slf4j-simple` requires the explicit `-Dorg.jboss.logging.provider=slf4j` system property because JBoss Logging only auto-discovers SLF4J when Logback is present.
+