Class DecoratedEventLogger

java.lang.Object
org.infinispan.util.logging.events.impl.DecoratedEventLogger
All Implemented Interfaces:
Listenable, EventLogger

public class DecoratedEventLogger extends Object implements EventLogger
DecoratedEventLogger. Provides a way to decorate an EventLog with additional information.
Since:
8.2
Author:
Tristan Tarrant
  • Field Details

    • detail

      protected String detail
    • context

      protected String context
    • scope

      protected String scope
    • who

      protected String who
  • Constructor Details

    • DecoratedEventLogger

      protected DecoratedEventLogger(EventLogger delegate)
  • Method Details

    • log

      public void log(EventLogLevel level, EventLogCategory category, String message)
      Description copied from interface: EventLogger
      Logs a message to the event log with the specified level
      Specified by:
      log in interface EventLogger
      Parameters:
      level - the severity level of the event
      message - the message to log
    • addLogsToBuilder

      protected void addLogsToBuilder(StringBuilder sb)
    • who

      public EventLogger who(String who)
      Description copied from interface: EventLogger
      Sets a security name for this event log.
      Specified by:
      who in interface EventLogger
      Parameters:
      who - the security name
      Returns:
      the event logger
    • scope

      public EventLogger scope(String scope)
      Description copied from interface: EventLogger
      Sets the scope of this event log, e.g. a node address. This should be used for events which reference a single node in the cluster
      Specified by:
      scope in interface EventLogger
      Parameters:
      scope - a scope
      Returns:
      the event logger
    • scope

      public EventLogger scope(Address scope)
      Description copied from interface: EventLogger
      Sets a node address as the scope of this event log
      Specified by:
      scope in interface EventLogger
      Parameters:
      scope - the address of the node
      Returns:
      the event logger
    • context

      public EventLogger context(String context)
      Description copied from interface: EventLogger
      Sets a context of this event log.
      Specified by:
      context in interface EventLogger
      Parameters:
      context - the name of the context
      Returns:
      the event logger
    • detail

      public EventLogger detail(String detail)
      Description copied from interface: EventLogger
      Sets a detail for this event log which could include additional information.
      Specified by:
      detail in interface EventLogger
      Parameters:
      detail - the event log detail
      Returns:
      the event logger
    • getEvents

      public List<EventLog> getEvents(Instant start, int count, Optional<EventLogCategory> category, Optional<EventLogLevel> level)
      Description copied from interface: EventLogger
      Retrieves the event logs from the cluster within the specified range
      Specified by:
      getEvents in interface EventLogger
      Parameters:
      start - the instant from which to retrieve the logs
      count - the number of logs to retrieve
      category - an optional category filter
      level - an optional level filter
      Returns:
      a list of EventLogs
    • addListenerAsync

      public CompletionStage<Void> addListenerAsync(Object listener)
      Description copied from interface: Listenable
      Asynchronous version of Listenable.addListener(Object)
      Specified by:
      addListenerAsync in interface Listenable
      Parameters:
      listener - listener to add, must not be null
      Returns:
      CompletionStage that when complete the listener is fully installed
    • removeListenerAsync

      public CompletionStage<Void> removeListenerAsync(Object listener)
      Description copied from interface: Listenable
      Asynchronous version of Listenable.removeListener(Object)
      Specified by:
      removeListenerAsync in interface Listenable
      Parameters:
      listener - listener to remove, must not be null
      Returns:
      CompletionStage that when complete the listener is fully removed