java.lang.Object
com.iqser.red.service.redaction.v1.server.logger.RulesLogger

public class RulesLogger extends Object
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 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

      public void info(String message, Object... args)
      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

      public void warn(String message, Object... args)
      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

      public void logObjectTracking(String message, Object... args)
      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

      public void logAgendaTracking(String message, Object... args)
      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

      public void error(Throwable throwable, String message, Object... args)
      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()