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

This commit is contained in:
Andrei Isvoran 2024-06-26 10:28:04 +03:00
parent d10e3f9b69
commit d6d4d50f91

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