Class RulesLogger
java.lang.Object
com.iqser.red.service.redaction.v1.server.logger.RulesLogger
This class provides logging functionality specifically for rules execution
in a Drools context. It is designed to log messages with different log levels
(INFO, WARN, ERROR) and formats messages using a placeholder-based approach
similar to popular logging frameworks like SLF4J.
Log messages can include placeholders (i.e., `{}`), which will be replaced by the corresponding arguments when the message is formatted.
Example usage:
logger.info("Message with placeholder {}", object);
-
Constructor Summary
ConstructorsConstructorDescriptionRulesLogger
(com.iqser.red.service.redaction.v1.server.service.websocket.WebSocketService webSocketService, com.iqser.red.service.redaction.v1.server.logger.Context context) -
Method Summary
Modifier and TypeMethodDescriptionvoid
If agenda tracking is disabled, the RulesLogger won't log any rule firings.void
If object tracking is disabled, the RulesLogger won't log any inserted/retracted/updated events.void
If agenda tracking is enabled, the RulesLogger will log each firing Rule with its name, objects and metadata.void
If object tracking is enabled, the RulesLogger will log all inserted/retracted/updated events.void
Logs a message at the ERROR level, including an exception.void
Logs a message at the INFO level.boolean
boolean
void
logAgendaTracking
(String message, Object... args) Logs a message at the INFO level, if agenda tracking has been activated.void
logObjectTracking
(String message, Object... args) Logs a message at the INFO level, if object tracking has been activated.void
Logs a message at the WARN level.
-
Constructor Details
-
RulesLogger
public RulesLogger(com.iqser.red.service.redaction.v1.server.service.websocket.WebSocketService webSocketService, com.iqser.red.service.redaction.v1.server.logger.Context context)
-
-
Method Details
-
info
Logs a message at the INFO level.- Parameters:
message
- The log message containing optional placeholders (i.e., `{}`).args
- The arguments to replace the placeholders in the message.
-
warn
Logs a message at the WARN level.- Parameters:
message
- The log message containing optional placeholders (i.e., `{}`).args
- The arguments to replace the placeholders in the message.
-
logObjectTracking
Logs a message at the INFO level, if object tracking has been activated.- Parameters:
message
- The log message containing optional placeholders (i.e., `{}`).args
- The arguments to replace the placeholders in the message.
-
enableObjectTracking
public void enableObjectTracking()If object tracking is enabled, the RulesLogger will log all inserted/retracted/updated events. Initial value is disabled. -
disableObjectTracking
public void disableObjectTracking()If object tracking is disabled, the RulesLogger won't log any inserted/retracted/updated events. Initial value is disabled. -
logAgendaTracking
Logs a message at the INFO level, if agenda tracking has been activated.- Parameters:
message
- The log message containing optional placeholders (i.e., `{}`).args
- The arguments to replace the placeholders in the message.
-
enableAgendaTracking
public void enableAgendaTracking()If agenda tracking is enabled, the RulesLogger will log each firing Rule with its name, objects and metadata. Initial value is disabled. -
disableAgendaTracking
public void disableAgendaTracking()If agenda tracking is disabled, the RulesLogger won't log any rule firings. Initial value is disabled. -
error
Logs a message at the ERROR level, including an exception.- Parameters:
throwable
- The exception to log.message
- The log message containing optional placeholders (i.e., `{}`).args
- The arguments to replace the placeholders in the message.
-
isObjectTrackingActive
public boolean isObjectTrackingActive() -
isAgendaTrackingActive
public boolean isAgendaTrackingActive()
-