public interface LogEntry
The LogEntry interface represents a log entry with various properties such as message, logger name, time, level, marker, and throwable.
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringFormats the log entry with the given prefix and suffix.level()Returns the log level of the LogEntry.Returns the name of the logger associated with the log entry.marker()Returns the marker associated with this log entry.message()Retrieves the message of the log entry.Returns the throwable object associated with this LogEntry.time()Returns the time when the logging event was created as an Instant object.
-
Method Details
-
message
String message()Retrieves the message of the log entry.- Returns:
- The message of the log entry.
-
loggerName
String loggerName()Returns the name of the logger associated with the log entry.- Returns:
- The name of the logger.
-
time
Instant time()Returns the time when the logging event was created as an Instant object.- Returns:
- the creation time of the logging event as an Instant object
-
level
LogLevel level()Returns the log level of the LogEntry.- Returns:
- the log level of the LogEntry
-
marker
String marker()Returns the marker associated with this log entry.- Returns:
- the marker
-
throwable
Throwable throwable()Returns the throwable object associated with this LogEntry.- Returns:
- the throwable object associated with this LogEntry, or null if no throwable is present
-
format
Formats the log entry with the given prefix and suffix.- Parameters:
prefix- the prefix to prepend to the formatted entrysuffix- the suffix to append to the formatted entry- Returns:
- the formatted log entry as a string
-