public class FlumeEvent extends org.apache.flume.event.SimpleEvent implements org.apache.logging.log4j.core.LogEvent
Constructor and Description |
---|
FlumeEvent(org.apache.logging.log4j.core.LogEvent event,
String includes,
String excludes,
String required,
String mdcPrefix,
String eventPrefix,
boolean compress)
Construct the FlumeEvent.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addContextData(String prefix,
Map<String,String> fields,
Map<String,String> context) |
protected void |
addMapData(String prefix,
Map<String,String> fields,
org.apache.logging.log4j.message.MapMessage<?,String> msg) |
protected void |
addStructuredData(String prefix,
Map<String,String> fields,
org.apache.logging.log4j.message.StructuredDataMessage msg) |
org.apache.logging.log4j.util.ReadOnlyStringMap |
getContextData()
Returns the context data of the
LogEvent that this FlumeEvent was constructed with. |
Map<String,String> |
getContextMap()
Returns a copy of the context Map.
|
org.apache.logging.log4j.ThreadContext.ContextStack |
getContextStack()
Returns a copy of the context stack.
|
org.apache.logging.log4j.core.time.Instant |
getInstant() |
org.apache.logging.log4j.Level |
getLevel()
Returns the logging Level.
|
String |
getLoggerFqcn()
Get the Frequently Qualified Class Name.
|
String |
getLoggerName()
Returns the logger name.
|
org.apache.logging.log4j.Marker |
getMarker()
Returns the Marker.
|
org.apache.logging.log4j.message.Message |
getMessage()
Returns 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()
Returns the StackTraceElement for the caller of the logging API.
|
long |
getThreadId()
Returns the ID of the Thread.
|
String |
getThreadName()
Returns the name of the Thread.
|
int |
getThreadPriority()
Returns the priority of the Thread.
|
Throwable |
getThrown()
Returns the Throwable associated with the event, if any.
|
org.apache.logging.log4j.core.impl.ThrowableProxy |
getThrownProxy()
Returns the Throwable associated with the event, if any.
|
long |
getTimeMillis()
Returns the event timestamp.
|
boolean |
isEndOfBatch() |
boolean |
isIncludeLocation() |
void |
setBody(byte[] body)
Set the body in the event.
|
void |
setEndOfBatch(boolean endOfBatch) |
void |
setIncludeLocation(boolean includeLocation) |
org.apache.logging.log4j.core.LogEvent |
toImmutable() |
public FlumeEvent(org.apache.logging.log4j.core.LogEvent event, String includes, String excludes, String required, String mdcPrefix, String eventPrefix, boolean compress)
event
- The Log4j LogEvent.includes
- A comma separated list of MDC elements to include.excludes
- A comma separated list of MDC elements to exclude.required
- A comma separated list of MDC elements that are required to be defined.mdcPrefix
- The value to prefix to MDC keys.eventPrefix
- The value to prefix to event keys.compress
- If true the event body should be compressed.protected void addStructuredData(String prefix, Map<String,String> fields, org.apache.logging.log4j.message.StructuredDataMessage msg)
protected void addMapData(String prefix, Map<String,String> fields, org.apache.logging.log4j.message.MapMessage<?,String> msg)
protected void addContextData(String prefix, Map<String,String> fields, Map<String,String> context)
public org.apache.logging.log4j.core.LogEvent toImmutable()
toImmutable
in interface org.apache.logging.log4j.core.LogEvent
public void setBody(byte[] body)
setBody
in interface org.apache.flume.Event
setBody
in class org.apache.flume.event.SimpleEvent
body
- The body to add to the event.public String getLoggerFqcn()
getLoggerFqcn
in interface org.apache.logging.log4j.core.LogEvent
public org.apache.logging.log4j.Level getLevel()
getLevel
in interface org.apache.logging.log4j.core.LogEvent
public String getLoggerName()
getLoggerName
in interface org.apache.logging.log4j.core.LogEvent
public StackTraceElement getSource()
getSource
in interface org.apache.logging.log4j.core.LogEvent
public org.apache.logging.log4j.message.Message getMessage()
getMessage
in interface org.apache.logging.log4j.core.LogEvent
public org.apache.logging.log4j.Marker getMarker()
getMarker
in interface org.apache.logging.log4j.core.LogEvent
public long getThreadId()
getThreadId
in interface org.apache.logging.log4j.core.LogEvent
public int getThreadPriority()
getThreadPriority
in interface org.apache.logging.log4j.core.LogEvent
public String getThreadName()
getThreadName
in interface org.apache.logging.log4j.core.LogEvent
public long getTimeMillis()
getTimeMillis
in interface org.apache.logging.log4j.core.LogEvent
public org.apache.logging.log4j.core.time.Instant getInstant()
getInstant
in interface org.apache.logging.log4j.core.LogEvent
public long getNanoTime()
getNanoTime
in interface org.apache.logging.log4j.core.LogEvent
public Throwable getThrown()
getThrown
in interface org.apache.logging.log4j.core.LogEvent
public org.apache.logging.log4j.core.impl.ThrowableProxy getThrownProxy()
getThrownProxy
in interface org.apache.logging.log4j.core.LogEvent
public Map<String,String> getContextMap()
getContextMap
in interface org.apache.logging.log4j.core.LogEvent
public org.apache.logging.log4j.util.ReadOnlyStringMap getContextData()
LogEvent
that this FlumeEvent
was constructed with.getContextData
in interface org.apache.logging.log4j.core.LogEvent
LogEvent
that this FlumeEvent
was constructed with.public org.apache.logging.log4j.ThreadContext.ContextStack getContextStack()
getContextStack
in interface org.apache.logging.log4j.core.LogEvent
public boolean isIncludeLocation()
isIncludeLocation
in interface org.apache.logging.log4j.core.LogEvent
public void setIncludeLocation(boolean includeLocation)
setIncludeLocation
in interface org.apache.logging.log4j.core.LogEvent
public boolean isEndOfBatch()
isEndOfBatch
in interface org.apache.logging.log4j.core.LogEvent
public void setEndOfBatch(boolean endOfBatch)
setEndOfBatch
in interface org.apache.logging.log4j.core.LogEvent
Copyright © 1999-1969 The 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.