Chapter 88. Configuring a logging utility in the decision engine

The decision engine uses the Java logging API SLF4J for system logging. You can use one of the following logging utilities with the decision engine to investigate decision engine activity, such as for troubleshooting or data gathering:

  • Logback
  • Apache Commons Logging
  • Apache Log4j
  • java.util.logging package

Procedure

For the logging utility that you want to use, add the relevant dependency to your Maven project or save the relevant XML configuration file in the org.drools package of your Red Hat Decision Manager distribution:

Example Maven dependency for Logback

<dependency>
  <groupId>ch.qos.logback</groupId>
  <artifactId>logback-classic</artifactId>
  <version>${logback.version}</version>
</dependency>

Example logback.xml configuration file in org.drools package

<configuration>
  <logger name="org.drools" level="debug"/>
  ...
<configuration>

Example log4j.xml configuration file in org.drools package

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
  <category name="org.drools">
    <priority value="debug" />
  </category>
  ...
</log4j:configuration>

Note

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