Record Class LogEntry
java.lang.Object
java.lang.Record
org.apache.sling.commons.log.logback.store.LogEntry
public record LogEntry(long timeMillis, LogLevel level, String loggerName, String threadName, String formattedMessage, String throwableText, Map<String,String> mdc)
extends Record
Snapshot of a log entry.
Stores only the lightweight, stable parts of a log event so the log store does not retain full logging event object graphs.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theformattedMessagerecord component.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.Returns the value of thethreadNamerecord component.Returns the value of thethrowableTextrecord component.longReturns the value of thetimeMillisrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LogEntry
public LogEntry(long timeMillis, LogLevel level, String loggerName, String threadName, String formattedMessage, String throwableText, Map<String, String> mdc) Creates an instance of aLogEntryrecord class.- Parameters:
timeMillis- the value for thetimeMillisrecord componentlevel- the value for thelevelrecord componentloggerName- the value for theloggerNamerecord componentthreadName- the value for thethreadNamerecord componentformattedMessage- the value for theformattedMessagerecord componentthrowableText- the value for thethrowableTextrecord componentmdc- the value for themdcrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
timeMillis
public long timeMillis()Returns the value of thetimeMillisrecord component.- Returns:
- the value of the
timeMillisrecord 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
-
formattedMessage
Returns the value of theformattedMessagerecord component.- Returns:
- the value of the
formattedMessagerecord component
-
throwableText
Returns the value of thethrowableTextrecord component.- Returns:
- the value of the
throwableTextrecord component
-
mdc
Returns the value of themdcrecord component.- Returns:
- the value of the
mdcrecord component
-