It is important for a library which aims to integrate as a software component in an existing system to provide accurate and concise execution traces, adapted to the situation (development, qualification, production). It also has to integrate with the log system adopted by the master software without being intrusive, meaning without the necessity of third party library.

To meet these specifications, MRules has chosen to develop an internal log interface, redirecting log messages to an external interface.

Accepted external log interfaces cover the majority of applications. These are, in order of priority, slf4j, log4j and JDK-integrated java.util.logging library. No configuration is necessary: a search of available Logger is performed at initialization.

Regarding the verbosity of logs, different levels (DEBUG, INFO, WARN, and ERROR) will give different information, corresponding to the needs of the teams having to interpret them.

Finally, all the execution logs of a given RuleSet instance are grouped within the same logger, in order to easily trace the different stages of compilation or execution.

Compilation and Execution have two distinct loggers in order to be able to configure their log level independently. Logger names are build as follows by default:

  • com.massa.mrules.set.COMPILE.<RuleSet name>
  • com.massa.mrules.set.EXECUTE.<RuleSet name>

As the logger is hold by the context, it is perfectly possible to override its default name for a given execution to trace it precisely.

Here is an extract of log4j configuration for tracing the execution of a particular rule engine instance if needed: