Record Class AlertEvent
java.lang.Object
java.lang.Record
com.github.catomat0.aoploghelper.alert.AlertEvent
public record AlertEvent(Instant timestamp, String level, String loggerName, String threadName, String message, Map<String,String> mdc, String stackTrace)
extends Record
Immutable snapshot of a log event captured for asynchronous webhook delivery.
The appender takes this snapshot on the logging thread and hands it to a dispatcher so we never block the calling code waiting for the HTTP call.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.level()Returns the value of thelevelrecord component.Returns the value of theloggerNamerecord component.mdc()Returns the value of themdcrecord component.message()Returns the value of themessagerecord component.Returns the value of thestackTracerecord component.Returns the value of thethreadNamerecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AlertEvent
public AlertEvent(Instant timestamp, String level, String loggerName, String threadName, String message, Map<String, String> mdc, String stackTrace) Creates an instance of aAlertEventrecord class.- Parameters:
timestamp- the value for thetimestamprecord componentlevel- the value for thelevelrecord componentloggerName- the value for theloggerNamerecord componentthreadName- the value for thethreadNamerecord componentmessage- the value for themessagerecord componentmdc- the value for themdcrecord componentstackTrace- the value for thestackTracerecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
level
Returns the value of thelevelrecord component.- Returns:
- the value of the
levelrecord component
-
loggerName
Returns the value of theloggerNamerecord component.- Returns:
- the value of the
loggerNamerecord component
-
threadName
Returns the value of thethreadNamerecord component.- Returns:
- the value of the
threadNamerecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
mdc
Returns the value of themdcrecord component.- Returns:
- the value of the
mdcrecord component
-
stackTrace
Returns the value of thestackTracerecord component.- Returns:
- the value of the
stackTracerecord component
-