public interface LogEvent extends Serializable
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
getContextMap()
Gets the MDC data.
|
ThreadContext.ContextStack |
getContextStack()
Gets the NDC data.
|
String |
getFQCN()
Returns the fully qualified class name of the caller of the logging api.
|
Level |
getLevel()
Gets the level.
|
String |
getLoggerName()
Gets the logger name.
|
Marker |
getMarker()
Gets the Marker associated with the event.
|
Message |
getMessage()
Gets the message associated with the event.
|
long |
getMillis()
Gets event time in milliseconds since midnight, January 1, 1970 UTC.
|
StackTraceElement |
getSource()
Gets the source of logging request.
|
String |
getThreadName()
Gets thread name.
|
Throwable |
getThrown()
Gets throwable associated with logging request.
|
boolean |
isEndOfBatch()
Returns
true if this event is the last one in a batch, false otherwise. |
boolean |
isIncludeLocation()
Returns whether the source of the logging request is required downstream.
|
void |
setEndOfBatch(boolean endOfBatch)
Sets whether this event is the last one in a batch.
|
void |
setIncludeLocation(boolean locationRequired)
Sets whether the source of the logging request is required downstream.
|
Map<String,String> getContextMap()
ThreadContext.ContextStack getContextStack()
String getFQCN()
Level getLevel()
String getLoggerName()
Marker getMarker()
Message getMessage()
long getMillis()
System.currentTimeMillis()
StackTraceElement getSource()
String getThreadName()
Throwable getThrown()
boolean isEndOfBatch()
true
if this event is the last one in a batch, false
otherwise. Used by asynchronous
Loggers and Appenders to signal to buffered downstream components when to flush to disk, as a more efficient
alternative to the immediateFlush=true
configuration.boolean isIncludeLocation()
StackTrace
snapshot or not before handing off this event to
another thread.true
if the source of the logging request is required downstream, false
otherwise.getSource()
void setEndOfBatch(boolean endOfBatch)
immediateFlush=true
configuration.endOfBatch
- true
if this event is the last one in a batch, false
otherwise.void setIncludeLocation(boolean locationRequired)
StackTrace
snapshot or not before handing off this event to
another thread.locationRequired
- true
if the source of the logging request is required downstream, false
otherwise.getSource()
Copyright © 1999-2014 Apache Software Foundation. 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.