Serializable
, LogEvent
@MappedSuperclass public abstract class BasicLogEventEntity extends AbstractLogEventWrapperEntity
AbstractLogEventWrapperEntity
. This class
implements all of the required mutator methods but does not implement a mutable entity ID property. In order to
create an entity based on this class, you need only create two constructors matching this class's constructors,
annotate the class @Entity
and @Table
, and implement
the fully mutable entity ID property annotated with @Id
and
@GeneratedValue
to tell the JPA provider how to calculate an ID for new
events.@Column
annotation to specify the column name.getContextMap()
and getContextStack()
attributes in this entity use the
ContextMapAttributeConverter
and ContextStackAttributeConverter
, respectively. These convert the
properties to simple strings that cannot be converted back to the properties. If you wish to instead convert these to
a reversible JSON string, override these attributes with the same annotations but use the
ContextMapJsonAttributeConverter
and
ContextStackJsonAttributeConverter
instead.@Transient
.AbstractLogEventWrapperEntity
,
Serialized FormConstructor | Description |
---|---|
BasicLogEventEntity() |
Instantiates this base class.
|
BasicLogEventEntity(LogEvent wrappedEvent) |
Instantiates this base class.
|
Modifier and Type | Method | Description |
---|---|---|
Map<String,String> |
getContextMap() |
Gets the context map.
|
ThreadContext.ContextStack |
getContextStack() |
Gets the context stack.
|
Level |
getLevel() |
Gets the level.
|
String |
getLoggerFqcn() |
Gets the fully qualified class name of the caller of the logger API.
|
String |
getLoggerName() |
Gets the logger name.
|
Marker |
getMarker() |
Gets the marker.
|
Message |
getMessage() |
Gets the message.
|
long |
getNanoTime() |
Returns the value of the running Java Virtual Machine's high-resolution time source when this event was created,
or a dummy value if it is known that this value will not be used downstream.
|
StackTraceElement |
getSource() |
Gets the source location information.
|
long |
getThreadId() |
Gets the thread ID.
|
String |
getThreadName() |
Gets the thread name.
|
int |
getThreadPriority() |
Gets the thread name.
|
Throwable |
getThrown() |
Gets the exception logged.
|
ThrowableProxy |
getThrownProxy() |
Gets the exception logged.
|
long |
getTimeMillis() |
Gets the number of milliseconds since JVM launch.
|
getContextData, getWrappedEvent, isEndOfBatch, isIncludeLocation, setContextData, setContextMap, setContextStack, setEndOfBatch, setIncludeLocation, setLevel, setLoggerFqcn, setLoggerName, setMarker, setMessage, setNanoTime, setSource, setThreadId, setThreadName, setThreadPriority, setThrown, setTimeMillis, toImmutable
public BasicLogEventEntity()
public BasicLogEventEntity(LogEvent wrappedEvent)
wrappedEvent
- The underlying event from which information is obtained.public Level getLevel()
@Basic
and @Enumerated(EnumType.STRING)
.public String getLoggerName()
@Basic
.public StackTraceElement getSource()
@Convert(converter = StackTraceElementAttributeConverter.class)
.StackTraceElementAttributeConverter
public Message getMessage()
@Convert(converter = MessageAttributeConverter.class)
.MessageAttributeConverter
public Marker getMarker()
@Convert(converter = MarkerAttributeConverter.class)
.MarkerAttributeConverter
public long getThreadId()
@Basic
.public int getThreadPriority()
@Basic
.public String getThreadName()
@Basic
.public long getTimeMillis()
@Basic
.System.currentTimeMillis()
public long getNanoTime()
public Throwable getThrown()
@Convert(converter = ThrowableAttributeConverter.class)
.ThrowableAttributeConverter
public ThrowableProxy getThrownProxy()
@Convert(converter = ThrowableAttributeConverter.class)
.ThrowableAttributeConverter
public Map<String,String> getContextMap()
@Convert(converter = ContextMapAttributeConverter.class)
.ContextMapAttributeConverter
,
ContextMapJsonAttributeConverter
public ThreadContext.ContextStack getContextStack()
@Convert(converter = ContextStackAttributeConverter.class)
.ContextStackAttributeConverter
,
ContextStackJsonAttributeConverter
public String getLoggerFqcn()
@Basic
.Copyright © 1999-2018. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.