org.apache.logging.log4j.flume.appender

Class FlumeEvent

  • java.lang.Object
    • org.apache.flume.event.SimpleEvent
      • org.apache.logging.log4j.flume.appender.FlumeEvent
  • All Implemented Interfaces:
    Serializable, org.apache.flume.Event, LogEvent


    public class FlumeEvent
    extends org.apache.flume.event.SimpleEvent
    implements LogEvent
    Class that is both a Flume and Log4j Event.
    See Also:
    Serialized Form
    • Constructor Detail

      • FlumeEvent

        public FlumeEvent(LogEvent event,
                  String includes,
                  String excludes,
                  String required,
                  String mdcPrefix,
                  String eventPrefix,
                  boolean compress)
        Construct the FlumeEvent.
        Parameters:
        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.
    • Method Detail

      • setBody

        public void setBody(byte[] body)
        Set the body in the event.
        Specified by:
        setBody in interface org.apache.flume.Event
        Overrides:
        setBody in class org.apache.flume.event.SimpleEvent
        Parameters:
        body - The body to add to the event.
      • getLoggerFqcn

        public String getLoggerFqcn()
        Get the Frequently Qualified Class Name.
        Specified by:
        getLoggerFqcn in interface LogEvent
        Returns:
        the FQCN String.
      • getLevel

        public Level getLevel()
        Returns the logging Level.
        Specified by:
        getLevel in interface LogEvent
        Returns:
        the Level.
      • getLoggerName

        public String getLoggerName()
        Returns the logger name.
        Specified by:
        getLoggerName in interface LogEvent
        Returns:
        the logger name.
      • getSource

        public StackTraceElement getSource()
        Returns the StackTraceElement for the caller of the logging API.
        Specified by:
        getSource in interface LogEvent
        Returns:
        the StackTraceElement of the caller.
      • getMessage

        public Message getMessage()
        Returns the Message.
        Specified by:
        getMessage in interface LogEvent
        Returns:
        the Message.
      • getMarker

        public Marker getMarker()
        Returns the Marker.
        Specified by:
        getMarker in interface LogEvent
        Returns:
        the Marker.
      • getThreadName

        public String getThreadName()
        Returns the name of the Thread.
        Specified by:
        getThreadName in interface LogEvent
        Returns:
        the name of the Thread.
      • getTimeMillis

        public long getTimeMillis()
        Returns the event timestamp.
        Specified by:
        getTimeMillis in interface LogEvent
        Returns:
        the event timestamp.
      • getNanoTime

        public 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.
        Specified by:
        getNanoTime in interface LogEvent
        Returns:
        the event nanosecond timestamp.
      • getThrown

        public Throwable getThrown()
        Returns the Throwable associated with the event, if any.
        Specified by:
        getThrown in interface LogEvent
        Returns:
        the Throwable.
      • getThrownProxy

        public ThrowableProxy getThrownProxy()
        Returns the Throwable associated with the event, if any.
        Specified by:
        getThrownProxy in interface LogEvent
        Returns:
        the Throwable.
      • getContextMap

        public Map<String,String> getContextMap()
        Returns a copy of the context Map.
        Specified by:
        getContextMap in interface LogEvent
        Returns:
        a copy of the context Map.
      • setIncludeLocation

        public void setIncludeLocation(boolean includeLocation)
        Specified by:
        setIncludeLocation in interface LogEvent
      • setEndOfBatch

        public void setEndOfBatch(boolean endOfBatch)
        Specified by:
        setEndOfBatch in interface LogEvent

Copyright © 1999-2015 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.