Package org.apache.sling.commons.log.logback.store

# 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
Constructor
Description
`LogEntry(long timeMillis, LogLevel level, String loggerName, String threadName, String formattedMessage, String throwableText, Map<String,String> mdc)`
Creates an instance of a `LogEntry` record class.

## Method Summary

Modifier and Type
Method
Description
`final boolean`
`equals(Object o)`
Indicates whether some other object is "equal to" this one.
`String`
`formattedMessage()`
Returns the value of the `formattedMessage` record component.
`final int`
`hashCode()`
Returns a hash code value for this object.
`LogLevel`
`level()`
Returns the value of the `level` record component.
`String`
`loggerName()`
Returns the value of the `loggerName` record component.
`Map<String,String>`
`mdc()`
Returns the value of the `mdc` record component.
`String`
`threadName()`
Returns the value of the `threadName` record component.
`String`
`throwableText()`
Returns the value of the `throwableText` record component.
`long`
`timeMillis()`
Returns the value of the `timeMillis` record component.
`final String`
`toString()`
Returns a string representation of this record class.

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## 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 a `LogEntry` 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 '=='.

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 LogLevel 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