Interface LogTail

  • All Superinterfaces:
    Iterable<LogEvent>
    All Known Subinterfaces:
    LoggerTail
    All Known Implementing Classes:
    LogQueue

    public interface LogTail
    extends Iterable<LogEvent>
    Extends Logger and provide tail-like APIs to navigate in it.
    Since:
    11.9RC1
    Version:
    $Id: c82686e0053d43c2984474118aef7c315ae351a1 $
    • Method Detail

      • log

        void log​(org.slf4j.Logger logger)
        Parameters:
        logger - the logger to send logs to
      • getLogEvent

        LogEvent getLogEvent​(int index)
        Parameters:
        index - the index of the log event
        Returns:
        the log event associated with the passed index or null if it does not exist
      • getLogEvents

        default LogTailResult getLogEvents​(int offset,
                                           int limit)
        Parameters:
        offset - the offset where to start searching for the log events
        limit - the maximum number of results to return
        Returns:
        the log events with the passed level or more
      • getFirstLogEvent

        default LogEvent getFirstLogEvent()
        Returns:
        the last log event
      • getLastLogEvent

        default LogEvent getLastLogEvent()
        Returns:
        the last log event
      • getFirstLogEvent

        LogEvent getFirstLogEvent​(LogLevel from)
        Parameters:
        from - the log level from which to select log events
        Returns:
        the first log event with passed level or more
      • getLastLogEvent

        LogEvent getLastLogEvent​(LogLevel from)
        Parameters:
        from - the log level from which to select log events
        Returns:
        the last log event with passed level or more
      • getLogEvents

        default LogTailResult getLogEvents​(LogLevel from)
        Parameters:
        from - the log level from which to select log events
        Returns:
        the log events with the passed level or more
      • getLogEvents

        LogTailResult getLogEvents​(LogLevel from,
                                   int offset,
                                   int limit)
        Parameters:
        from - the log level from which to select log events
        offset - the offset where to start searching for the log events
        limit - the maximum number of results to return
        Returns:
        the log events with the passed level or more
      • hasLogLevel

        boolean hasLogLevel​(LogLevel from)
        Parameters:
        from - the log level from which to select log events
        Returns:
        true if a log event with the passed log level or more was found
      • size

        int size()
        Returns:
        the number of log event in that tail