Package org.xwiki.logging.tail
Interface LogTail
-
- All Known Subinterfaces:
LoggerTail
- All Known Implementing Classes:
LogQueue
public interface LogTail extends Iterable<LogEvent>
ExtendsLogger
and provide tail-like APIs to navigate in it.- Since:
- 11.9RC1
- Version:
- $Id: c82686e0053d43c2984474118aef7c315ae351a1 $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default LogEvent
getFirstLogEvent()
LogEvent
getFirstLogEvent(LogLevel from)
default LogEvent
getLastLogEvent()
LogEvent
getLastLogEvent(LogLevel from)
LogEvent
getLogEvent(int index)
default LogTailResult
getLogEvents(int offset, int limit)
default LogTailResult
getLogEvents(LogLevel from)
LogTailResult
getLogEvents(LogLevel from, int offset, int limit)
boolean
hasLogLevel(LogLevel from)
void
log(org.slf4j.Logger logger)
int
size()
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
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 eventslimit
- 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 eventsoffset
- the offset where to start searching for the log eventslimit
- 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
-
-