Interface EventLogger

  • All Known Implementing Classes:
    BasicEventLogger, DecoratedEventLogger

    public interface EventLogger
    EventLogger provides an interface for logging event messages.
    Since:
    8.2
    Author:
    Tristan Tarrant
    • Method Detail

      • log

        void log​(EventLogLevel level,
                 EventLogCategory category,
                 String message)
        Logs a message to the event log with the specified level
        Parameters:
        level - the severity level of the event
        message - the message to log
      • scope

        default EventLogger scope​(String scope)
        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
        Parameters:
        scope - a scope
        Returns:
        the event logger
      • scope

        default EventLogger scope​(Address scope)
        Sets a node address as the scope of this event log
        Parameters:
        scope - the address of the node
        Returns:
        the event logger
      • context

        default EventLogger context​(Cache<?,​?> cache)
        Sets a cache as context of this event log. The name of the cache will be used to indicate the context.
        Parameters:
        cache - the cache to set as context
        Returns:
        the event logger
      • context

        default EventLogger context​(String context)
        Sets a context of this event log.
        Parameters:
        context - the name of the context
        Returns:
        the event logger
      • detail

        default EventLogger detail​(String detail)
        Sets a detail for this event log which could include additional information.
        Parameters:
        detail - the event log detail
        Returns:
        the event logger
      • detail

        default EventLogger detail​(Throwable t)
        Sets a throwable to include as detail for this event. Both the localized message of the Throwable as well as its stack trace will be recorded as the event's detail
        Parameters:
        detail - a throwable
        Returns:
        the event logger
      • who

        default EventLogger who​(Subject subject)
        Sets a security subject for this event log. The name of the main user principal of the subject will be recorded in the log.
        Parameters:
        subject - the security subject
        Returns:
        the event logger
      • who

        default EventLogger who​(Principal principal)
        Sets a security principal for this event log. The name of the principal will be recorded in the log.
        Parameters:
        principal - the security principal
        Returns:
        the event logger
      • who

        default EventLogger who​(String s)
        Sets a security name for this event log.
        Parameters:
        s - the security name
        Returns:
        the event logger
      • getEvents

        List<EventLog> getEvents​(Instant start,
                                 int count,
                                 Optional<EventLogCategory> category,
                                 Optional<EventLogLevel> level)
        Retrieves the event logs from the cluster within the specified range
        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