Record Class LogSnapshot

java.lang.Object
java.lang.Record
org.apache.sling.mcp.server.contribs.log.LogSnapshot

public record LogSnapshot(long timeMillis, String level, String loggerName, String threadName, String formattedMessage, String throwableText, Map<String,String> mdc) extends Record
Stores only the lightweight, stable parts of a log event so the in-memory buffer does not retain full logging event object graphs.
  • Constructor Details

    • LogSnapshot

      public LogSnapshot(long timeMillis, String level, String loggerName, String threadName, String formattedMessage, String throwableText, Map<String,String> mdc)
      Creates an instance of a LogSnapshot record class.
      Parameters:
      timeMillis - the value for the timeMillis record component
      level - the value for the level record component
      loggerName - the value for the loggerName record component
      threadName - the value for the threadName record component
      formattedMessage - the value for the formattedMessage record component
      throwableText - the value for the throwableText record component
      mdc - the value for the mdc record component
  • 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 the compare method from their corresponding wrapper classes.
      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.
    • timeMillis

      public long timeMillis()
      Returns the value of the timeMillis record component.
      Returns:
      the value of the timeMillis record component
    • level

      public String level()
      Returns the value of the level record component.
      Returns:
      the value of the level 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
    • formattedMessage

      public String formattedMessage()
      Returns the value of the formattedMessage record component.
      Returns:
      the value of the formattedMessage record component
    • throwableText

      public String throwableText()
      Returns the value of the throwableText record component.
      Returns:
      the value of the throwableText record component
    • mdc

      public Map<String,String> mdc()
      Returns the value of the mdc record component.
      Returns:
      the value of the mdc record component