Interface EventLogger
-
- All Known Implementing Classes:
BasicEventLogger,DecoratedEventLogger
public interface EventLoggerEventLogger provides an interface for logging event messages.- Since:
- 8.2
- Author:
- Tristan Tarrant
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default EventLoggercontext(String context)Sets a context of this event log.default EventLoggercontext(Cache<?,?> cache)Sets a cache as context of this event log.default EventLoggerdetail(String detail)Sets a detail for this event log which could include additional information.default EventLoggerdetail(Throwable t)Sets 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.FATALseverityList<EventLog>getEvents(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 EventLoggerscope(String scope)Sets the scope of this event log, e.g.default EventLoggerscope(Address scope)Sets 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 EventLoggerwho(String s)Sets a security name for this event log.default EventLoggerwho(Principal principal)Sets a security principal for this event log.default EventLoggerwho(Subject subject)Sets a security subject for this event log.
-
-
-
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 eventmessage- the message to log
-
info
default void info(EventLogCategory category, String message)
Logs a message to the event log using theEventLogLevel.INFOseverity- Parameters:
message- the message to log
-
warn
default void warn(EventLogCategory category, String message)
Logs a message to the event log using theEventLogLevel.WARNseverity- Parameters:
message- the message to log
-
error
default void error(EventLogCategory category, String message)
Logs a message to the event log using theEventLogLevel.ERRORseverity- Parameters:
message- the message to log
-
fatal
default void fatal(EventLogCategory category, String message)
Logs a message to the event log using theEventLogLevel.FATALseverity- Parameters:
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 logscount- the number of logs to retrievecategory- an optional category filterlevel- an optional level filter- Returns:
- a list of
EventLogs
-
-