6.6. Logging

The logging feature enables you to investigate what the Rule Engine does at the back-end. The rule engine uses Java logging API SLF4J for logging. The underlying logging backend can be Logback, Apache Commons Logging, Log4j, or java.util.logging. You can add a dependency to the logging adaptor for your logging framework of choice.
Here is an example of how to use Logback by adding a Maven dependency:
<dependency>
  <groupId>ch.qos.logback</groupId>
  <artifactId>logback-classic</artifactId>
  <version>1.x</version>
</dependency>

Note

If you are developing for an ultra light environment, use slf4j-nop or slf4j-simple.

6.6.1. Configuring Logging Level

Here is an example of how you can configure the logging level on the package org.drools in your logback.xml file when you are using Logback:
<configuration>
   <logger name="org.drools" level="debug"/>
    ...
    ...
<configuration>
Here is an example of how you can configure the logging level in your log4j.xml file when you are using Log4J:
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

    <category name="org.drools">
      <priority value="debug" />
    </category>
    ...

    ...

</log4j:configuration>