RED-9349 - Add possibility to log stuff in the rules #446

Merged
andrei.isvoran.ext merged 6 commits from RED-9349-rule-log into master 2024-06-26 10:17:59 +02:00
Showing only changes of commit d6d4d50f91 - Show all commits

View File

@ -0,0 +1,32 @@
package drools
import com.iqser.red.service.redaction.v1.server.logger.RulesLogger;
import com.iqser.red.service.redaction.v1.server.logger.Context;
global RulesLogger logger
global Context context
rule "LOG.0.0: Test log info"
salience 1
when
eval(true)
then
logger.info(context, "This is a test log {}", "placeholder");
end
rule "LOG.0.1: Test log warn"
salience 1
when
eval(true)
then
logger.warn(context, "This is a warning log with multiple placeholders {} {} {}", "p1", "p2", "p3");
end
rule "LOG.0.2: Test log error"
when
eval(true)
then
String result = null;
result.toString();
end