Package org.apache.logging.log4j.status
Class StatusData
- java.lang.Object
-
- org.apache.logging.log4j.status.StatusData
-
- All Implemented Interfaces:
Serializable
public class StatusData extends Object implements Serializable
The Status data.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StatusData(StackTraceElement caller, org.apache.logging.log4j.Level level, org.apache.logging.log4j.message.Message message, Throwable throwable, String threadName)Constructs the instance using given properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description StringgetFormattedStatus()Formats the event in to a log line for viewing.InstantgetInstant()Returns the instant of the event.org.apache.logging.log4j.LevelgetLevel()Returns the logging level for the event.org.apache.logging.log4j.MarkergetMarker()org.apache.logging.log4j.message.MessagegetMessage()Returns the message associated with the event.StackTraceElementgetStackTraceElement()Returns the method that created the event.StringgetThreadName()Returns the name of the thread associated with the event.ThrowablegetThrowable()Returns the error associated with the event.longgetTimestamp()Deprecated.since 2.23.0, usegetInstant()instead.StringtoString()
-
-
-
Constructor Detail
-
StatusData
public StatusData(@Nullable StackTraceElement caller, org.apache.logging.log4j.Level level, org.apache.logging.log4j.message.Message message, @Nullable Throwable throwable, @Nullable String threadName)Constructs the instance using given properties.- Parameters:
caller- the method that created the eventlevel- a logging levelmessage- a messagethrowable- the error occurredthreadName- the thread name- Since:
- 2.4
-
-
Method Detail
-
getInstant
public 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, usegetInstant()instead.Returns the instant of the event.- Returns:
- the event's instant
-
getStackTraceElement
@Nullable public StackTraceElement getStackTraceElement()
Returns the method that created the event.- Returns:
- the method that created the event
-
getLevel
public org.apache.logging.log4j.Level getLevel()
Returns the logging level for the event.- Returns:
- the event's logging level
-
getMarker
public org.apache.logging.log4j.Marker getMarker()
-
getMessage
public org.apache.logging.log4j.message.Message getMessage()
Returns the message associated with the event.- Returns:
- the message associated with the event
-
getThreadName
public 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
@Nullable public Throwable getThrowable()
Returns the error associated with the event.- Returns:
- the error associated with the event
-
getFormattedStatus
public String getFormattedStatus()
Formats the event in to a log line for viewing.- Returns:
- the formatted event
-
-