Show TOC

Procedure documentationDetermining a Method to Set Log Levels in Lean Rules Engine Locate this document in the navigation structure

 

You use this procedure to identify which method needs to be implemented to log the execution details of a rule by the Lean Rules Engine.

Note Note

The log information can include details such as the step-by-step execution of a ruleset, the state of the business objects, and the lifecycle of a rule. This information helps you in monitoring and analyzing the execution of rules.

There are multiple log levels provided by BRM as mentioned below:

Log Level

Description

No logging

Doesn’t log any information.

Basic (Default)

Logs basic information such as the project name, ruleset name, rule fired and the rule flow. This is the default log level.

Medium

Logs details of the basic log level along with the details such as definition value changed, business objects details, decision table evaluation rule, rulescript and gateway evaluation.

Advanced

Logs details of the medium log level along with the details such as condition evaluation details, action execution details, rulescript and gateway execution.

End of the note.

Procedure

Identify one of the following methods for setting log levels in Lean Rules Engine.

  • Setting a log level using RulesetContext method

    You can set the required log level using the setBusinessLogLevel() method available in Ruleset Context, which contains the required information for ruleset execution. In this case, the rules engine takes the log level value from the corresponding method, and generates the log details according to the log value set in the method. By default, the BASIC _BUSINESS_LOGGING log level is set.

    Syntax Syntax

    1. RulesetContext rulesetcontext= engine.createRulesetContext(<ProjectName>,<RulesetName>);
    2. rulescontext.setBusinessLogLevel(BusinessLogLevel.BASIC_BUSINESS_LOGGING);
    End of the code.

    The various log levels that you can set for RulesetContext method are mentioned below:

    • BusinessLogLevel.NO_BUSINESS_LOGGING

    • BusinessLogLevel.BASIC_BUSINESS_LOGGING

    • BusinessLogLevel.MEDIUM_BUSINESS_LOGGING

    • BusinessLogLevel.ADVANCED_BUSINESS_LOGGING

    Note Note

    The log level set using RulesetContext method takes higher priority over the log level set using ReteEngine property.

    End of the note.
  • Setting a log level using ReteEngine property

    You can set the required log level using the businessloglevel property available in ReteEngine. By default, two is set as the default value for the log level.

    Syntax Syntax

    1. Properties configuration = new Properities();
    2. Configuration.setProperty(“businessloglevel”,”2”);
    End of the code.

    The various log levels and the corresponding values that you can set for the businessloglevel property are mentioned below:

    Value

    Business Log levels

    1

    BusinessLogLevel.NO_BUSINESS_LOGGING

    2

    BusinessLogLevel.BASIC_BUSINESS_LOGGING

    3

    BusinessLogLevel.MEDIUM_BUSINESS_LOGGING

    4

    BusinessLogLevel.ADVANCED_BUSINESS_LOGGING

    Note Note

    You can change the default value by passing the required value for businessloglevel property to RulesEngineFactory.

    End of the note.