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 msg) |
protected void |
addStructuredData(String prefix,
Map<String,String> fields,
org.apache.logging.log4j.message.StructuredDataMessage msg) |
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.
|
String |
getFQCN()
Get the Frequently Qualified Class Name.
|
org.apache.logging.log4j.Level |
getLevel()
Returns the logging Level.
|
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 |
getMillis()
Returns the event timestamp.
|
StackTraceElement |
getSource()
Returns the StackTraceElement for the caller of the logging API.
|
String |
getThreadName()
Returns the name of the Thread.
|
Throwable |
getThrown()
Returns the Throwable associated with the event, if any.
|
boolean |
isEndOfBatch() |
boolean |
isIncludeLocation() |
void |
setBody(byte[] body)
Set the body in the event.
|
void |
setEndOfBatch(boolean endOfBatch) |
void |
setIncludeLocation(boolean includeLocation) |
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 msg)
protected void addContextData(String prefix, Map<String,String> fields, Map<String,String> context)
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 getFQCN()
getFQCN
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 String getThreadName()
getThreadName
in interface org.apache.logging.log4j.core.LogEvent
public long getMillis()
getMillis
in interface org.apache.logging.log4j.core.LogEvent
public Throwable getThrown()
getThrown
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.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-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.