Determining a Method to Set Log Levels in Lean Rules Engine
Use
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.
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.
RulesetContext rulesetcontext= engine.createRulesetContext(<ProjectName>,<RulesetName>); rulescontext.setBusinessLogLevel(BusinessLogLevel.BASIC_BUSINESS_LOGGING);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
-
-
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.
Properties configuration = new Properities(); Configuration.setProperty("businessloglevel","2");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