Interface EventLogger
- All Superinterfaces:
Listenable
- All Known Implementing Classes:
BasicEventLogger,DecoratedEventLogger
EventLogger provides an interface for logging event messages.
- Since:
- 8.2
- Author:
- Tristan Tarrant
-
Method Summary
Modifier and TypeMethodDescriptiondefault EventLoggerSets a context of this event log.default EventLoggerSets a cache as context of this event log.default EventLoggerSets a detail for this event log which could include additional information.default EventLoggerSets a throwable to include as detail for this event.default voiderror(EventLogCategory category, String message) Logs a message to the event log using theEventLogLevel.ERRORseveritydefault voidfatal(EventLogCategory category, String message) Logs a message to the event log using theEventLogLevel.FATALseveritygetEvents(Instant start, int count, Optional<EventLogCategory> category, Optional<EventLogLevel> level) Retrieves the event logs from the cluster within the specified rangedefault voidinfo(EventLogCategory category, String message) Logs a message to the event log using theEventLogLevel.INFOseverityvoidlog(EventLogLevel level, EventLogCategory category, String message) Logs a message to the event log with the specified leveldefault EventLoggerSets the scope of this event log, e.g.default EventLoggerSets a node address as the scope of this event logdefault voidwarn(EventLogCategory category, String message) Logs a message to the event log using theEventLogLevel.WARNseveritydefault EventLoggerSets a security name for this event log.default EventLoggerSets a security principal for this event log.default EventLoggerSets a security subject for this event log.Methods inherited from interface org.infinispan.notifications.Listenable
addListener, addListenerAsync, removeListener, removeListenerAsync
-
Method Details
-
log
Logs a message to the event log with the specified level- Parameters:
level- the severity level of the eventmessage- the message to log
-
info
Logs a message to the event log using theEventLogLevel.INFOseverity- Parameters:
message- the message to log
-
warn
Logs a message to the event log using theEventLogLevel.WARNseverity- Parameters:
message- the message to log
-
error
Logs a message to the event log using theEventLogLevel.ERRORseverity- Parameters:
message- the message to log
-
fatal
Logs a message to the event log using theEventLogLevel.FATALseverity- Parameters:
message- the message to log
-
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
Sets a node address as the scope of this event log- Parameters:
scope- the address of the node- Returns:
- the event logger
-
context
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
Sets a context of this event log.- Parameters:
context- the name of the context- Returns:
- the event logger
-
detail
Sets a detail for this event log which could include additional information.- Parameters:
detail- the event log detail- Returns:
- the event logger
-
detail
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
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
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
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 logscount- the number of logs to retrievecategory- an optional category filterlevel- an optional level filter- Returns:
- a list of
EventLogs
-