Class LogEvent
java.lang.Object
com.soklet.LogEvent
An informational "loggable" event that occurs during Soklet's internal processing - for example, if an error occurs while handling a request.
These events are exposed via LifecycleInterceptor.didReceiveLogEvent(LogEvent).
Instances can be acquired via the with(LogEventType, String) builder factory method.
Documentation is available at https://www.soklet.com/docs/request-lifecycle#event-logging.
- Author:
- Mark Allen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder used to construct instances ofLogEventviawith(LogEventType, String).static final class -
Method Summary
Modifier and TypeMethodDescriptioncopy()Vends a mutable copier seeded with this instance's data, suitable for building new instances.booleanThe type of log event this is.The response associated with this log event, if available.The message for this log event.The request associated with this log event, if available.The Resource Method associated with this log event, if available.The throwable for this log event, if available.inthashCode()toString()static LogEvent.Builderwith(LogEventType logEventType, String message) Acquires a builder forLogEventinstances.
-
Method Details
-
with
@Nonnull public static LogEvent.Builder with(@Nonnull LogEventType logEventType, @Nonnull String message) Acquires a builder forLogEventinstances.- Parameters:
logEventType- what kind of log event this ismessage- the message for this log event- Returns:
- the builder
-
copy
Vends a mutable copier seeded with this instance's data, suitable for building new instances.- Returns:
- a copier for this instance
-
toString
-
equals
-
hashCode
-
getLogEventType
The type of log event this is.- Returns:
- the log event type
-
getMessage
-
getThrowable
The throwable for this log event, if available.- Returns:
- the throwable, or
Optional.empty()if not available
-
getRequest
The request associated with this log event, if available.- Returns:
- the request, or
Optional.empty()if not available
-
getResourceMethod
The Resource Method associated with this log event, if available.- Returns:
- the Resource Method, or
Optional.empty()if not available
-
getMarshaledResponse
The response associated with this log event, if available.- Returns:
- the response, or
Optional.empty()if not available
-