Record Class ServerErrorSnapshot
java.lang.Object
java.lang.Record
nl.pim16aap2.lightkeeper.framework.ServerErrorSnapshot
- Record Components:
timestampMillis- Epoch milliseconds at which the event was created (structured events) or captured (raw stderr output).severity- Severity bucket; onlyServerErrorSnapshot.Severity.ERRORentries failLightkeeperAssertions.assertThat(framework).hasNoServerErrors().levelName- Original log level name (e.g."ERROR","WARN"), or"STDERR"for raw stderr output.loggerName- Name of the logger that emitted the event, orLOGGER_NAME_STDERRfor raw stderr output.threadName- Name of the emitting thread; empty when unknown.message- Formatted log message; for raw stderr output, the first line of the detected stack trace.throwableClass- Fully-qualified class name of the attached or detected throwable, ornullwhen absent.throwableMessage- Message of the attached or detected throwable, ornullwhen absent.stackTrace- Rendered stack trace lines including the cause chain (possibly truncated); empty when no throwable was attached.
public record ServerErrorSnapshot(long timestampMillis, ServerErrorSnapshot.Severity severity, String levelName, String loggerName, String threadName, String message, @Nullable String throwableClass, @Nullable String throwableMessage, List<String> stackTrace)
extends Record
Snapshot of a single captured server error or warning.
Entries originate from two complementary sources:
- Structured log events — captured inside the server by the agent's Log4j appender, carrying the real throwable class, message, and rendered cause chain of the original log event.
- Raw stderr output — stack traces written to the server process's raw stderr file
descriptor, bypassing the logging system entirely (for example Log4j's own status logger or JVM-native
output). These entries use
"STDERR"aslevelName()andLOGGER_NAME_STDERRasloggerName().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSeverity bucket of a captured entry. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringloggerName()used for entries detected in the server process's raw stderr output. -
Constructor Summary
ConstructorsConstructorDescriptionServerErrorSnapshot(long timestampMillis, ServerErrorSnapshot.Severity severity, String levelName, String loggerName, String threadName, String message, @Nullable String throwableClass, @Nullable String throwableMessage, List<String> stackTrace) Validates required fields and defensively copies the stack trace. -
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.Returns the value of thelevelNamerecord component.Returns the value of theloggerNamerecord component.message()Returns the value of themessagerecord component.severity()Returns the value of theseverityrecord component.Returns the value of thestackTracerecord component.Returns the value of thethreadNamerecord component.@Nullable StringReturns the value of thethrowableClassrecord component.@Nullable StringReturns the value of thethrowableMessagerecord component.longReturns the value of thetimestampMillisrecord component.toDisplayString(int maxStackTraceLines) Renders this entry as human-readable text: one header line plus indented stack-trace lines, capped at the given limit with a"... (N more stack trace lines)"tail when truncated.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
LOGGER_NAME_STDERR
loggerName()used for entries detected in the server process's raw stderr output.- See Also:
-
-
Constructor Details
-
ServerErrorSnapshot
public ServerErrorSnapshot(long timestampMillis, ServerErrorSnapshot.Severity severity, String levelName, String loggerName, String threadName, String message, @Nullable String throwableClass, @Nullable String throwableMessage, List<String> stackTrace) Validates required fields and defensively copies the stack trace.
-
-
Method Details
-
toDisplayString
Renders this entry as human-readable text: one header line plus indented stack-trace lines, capped at the given limit with a"... (N more stack trace lines)"tail when truncated.- Parameters:
maxStackTraceLines- Maximum number of stack-trace lines to render; useInteger.MAX_VALUEfor the full trace.- Returns:
- The rendered entry, ending with a line separator.
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
timestampMillis
public long timestampMillis()Returns the value of thetimestampMillisrecord component.- Returns:
- the value of the
timestampMillisrecord component
-
severity
Returns the value of theseverityrecord component.- Returns:
- the value of the
severityrecord component
-
levelName
Returns the value of thelevelNamerecord component.- Returns:
- the value of the
levelNamerecord 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
-
throwableClass
Returns the value of thethrowableClassrecord component.- Returns:
- the value of the
throwableClassrecord component
-
throwableMessage
Returns the value of thethrowableMessagerecord component.- Returns:
- the value of the
throwableMessagerecord component
-
stackTrace
Returns the value of thestackTracerecord component.- Returns:
- the value of the
stackTracerecord component
-