Record Class ServerErrorEntry

java.lang.Object
java.lang.Record
nl.pim16aap2.lightkeeper.protocol.ServerErrorEntry
Record Components:
timestampMillis - Epoch milliseconds at which the log event was created.
severity - Severity bucket derived from the numeric log level: "ERROR" for error-or-worse events, "WARNING" otherwise.
levelName - Original log level name (e.g. "ERROR", "WARN", "FATAL") for display purposes.
loggerName - Name of the logger that emitted the event.
threadName - Name of the thread that emitted the event.
message - Formatted log message.
throwableClass - Fully-qualified class name of the attached throwable, or null when the event carried none.
throwableMessage - Message of the attached throwable, or null when absent.
stackTrace - Rendered stack trace lines of the attached throwable including its cause chain (possibly truncated); empty when the event carried no throwable.

public record ServerErrorEntry(long timestampMillis, String severity, String levelName, String loggerName, String threadName, String message, @Nullable String throwableClass, @Nullable String throwableMessage, List<String> stackTrace) extends Record
Typed snapshot of a single captured server error or warning, carried directly inside protocol responses.

Entries are captured by the agent's Log4j appender as structured log events, so the throwable metadata reflects the actual Throwable attached to the log event rather than text scraped from console output.

  • Constructor Details

    • ServerErrorEntry

      public ServerErrorEntry(long timestampMillis, String 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

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • timestampMillis

      public long timestampMillis()
      Returns the value of the timestampMillis record component.
      Returns:
      the value of the timestampMillis record component
    • severity

      public String severity()
      Returns the value of the severity record component.
      Returns:
      the value of the severity record component
    • levelName

      public String levelName()
      Returns the value of the levelName record component.
      Returns:
      the value of the levelName record component
    • loggerName

      public String loggerName()
      Returns the value of the loggerName record component.
      Returns:
      the value of the loggerName record component
    • threadName

      public String threadName()
      Returns the value of the threadName record component.
      Returns:
      the value of the threadName record component
    • message

      public String message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component
    • throwableClass

      public @Nullable String throwableClass()
      Returns the value of the throwableClass record component.
      Returns:
      the value of the throwableClass record component
    • throwableMessage

      public @Nullable String throwableMessage()
      Returns the value of the throwableMessage record component.
      Returns:
      the value of the throwableMessage record component
    • stackTrace

      public List<String> stackTrace()
      Returns the value of the stackTrace record component.
      Returns:
      the value of the stackTrace record component