Class StatusData

  • All Implemented Interfaces:
    java.io.Serializable

    public class StatusData
    extends java.lang.Object
    implements java.io.Serializable
    The Status data.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      StatusData​(@Nullable java.lang.StackTraceElement caller, Level level, Message message, @Nullable java.lang.Throwable throwable, @Nullable java.lang.String threadName)
      Constructs the instance using given properties.
      StatusData​(@Nullable java.lang.StackTraceElement caller, Level level, Message message, @Nullable java.lang.Throwable throwable, @Nullable java.lang.String threadName, @Nullable java.time.format.DateTimeFormatter instantFormatter, java.time.Instant instant)  
    • Field Detail

      • instant

        private final java.time.Instant instant
      • instantFormatter

        private final java.time.format.DateTimeFormatter instantFormatter
      • caller

        private final @Nullable java.lang.StackTraceElement caller
      • level

        private final Level level
      • message

        private final Message message
      • threadName

        private final java.lang.String threadName
      • throwable

        private final @Nullable java.lang.Throwable throwable
    • Constructor Detail

      • StatusData

        public StatusData​(@Nullable java.lang.StackTraceElement caller,
                          Level level,
                          Message message,
                          @Nullable java.lang.Throwable throwable,
                          @Nullable java.lang.String threadName)
        Constructs the instance using given properties.
        Parameters:
        caller - the method that created the event
        level - a logging level
        message - a message
        throwable - the error occurred
        threadName - the thread name
        Since:
        2.4
      • StatusData

        StatusData​(@Nullable java.lang.StackTraceElement caller,
                   Level level,
                   Message message,
                   @Nullable java.lang.Throwable throwable,
                   @Nullable java.lang.String threadName,
                   @Nullable java.time.format.DateTimeFormatter instantFormatter,
                   java.time.Instant instant)
    • Method Detail

      • getInstant

        public java.time.Instant getInstant()
        Returns the instant of the event.
        Returns:
        the event's instant
        Since:
        2.23.0
      • getTimestamp

        @Deprecated
        public long getTimestamp()
        Deprecated.
        since 2.23.0, use getInstant() instead.
        Returns the instant of the event.
        Returns:
        the event's instant
      • getStackTraceElement

        public @Nullable java.lang.StackTraceElement getStackTraceElement()
        Returns the method that created the event.
        Returns:
        the method that created the event
      • getLevel

        public Level getLevel()
        Returns the logging level for the event.
        Returns:
        the event's logging level
      • getMessage

        public Message getMessage()
        Returns the message associated with the event.
        Returns:
        the message associated with the event
      • getThreadName

        public java.lang.String getThreadName()
        Returns the name of the thread associated with the event.
        Returns:
        the name of the thread associated with the event
        Since:
        2.4
      • getThrowable

        public @Nullable java.lang.Throwable getThrowable()
        Returns the error associated with the event.
        Returns:
        the error associated with the event
      • getFormattedStatus

        public java.lang.String getFormattedStatus()
        Formats the event in to a log line for viewing.
        Returns:
        the formatted event
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object