Class EventHubsAppender

  • All Implemented Interfaces:
    org.apache.logging.log4j.core.Appender, org.apache.logging.log4j.core.filter.Filterable, org.apache.logging.log4j.core.LifeCycle, org.apache.logging.log4j.core.LifeCycle2

    @Plugin(name="EventHub",
            category="Core",
            elementType="appender",
            printObject=true)
    public final class EventHubsAppender
    extends org.apache.logging.log4j.core.appender.AbstractAppender
    Sends LogEvent's to Microsoft Azure EventHubs. By default, tuned for high performance and hence, pushes a batch of Events.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.apache.logging.log4j.core.appender.AbstractAppender

        org.apache.logging.log4j.core.appender.AbstractAppender.Builder<B extends org.apache.logging.log4j.core.appender.AbstractAppender.Builder<B>>
      • Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle

        org.apache.logging.log4j.core.LifeCycle.State
    • Field Summary

      • Fields inherited from class org.apache.logging.log4j.core.AbstractLifeCycle

        DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
      • Fields inherited from interface org.apache.logging.log4j.core.Appender

        ELEMENT_TYPE
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void append​(org.apache.logging.log4j.core.LogEvent logEvent)  
      static EventHubsAppender createAppender​(String name, org.apache.logging.log4j.core.Filter filter, org.apache.logging.log4j.core.Layout<? extends Serializable> layout, boolean ignoreExceptions, String connectionString, boolean immediateFlush)  
      void start()  
      void stop()  
      • Methods inherited from class org.apache.logging.log4j.core.appender.AbstractAppender

        error, error, error, getHandler, getLayout, getName, ignoreExceptions, parseInt, setHandler, toSerializable, toString
      • Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilterable

        addFilter, getFilter, hasFilter, isFiltered, removeFilter, stop, stop
      • Methods inherited from class org.apache.logging.log4j.core.AbstractLifeCycle

        equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop
      • Methods inherited from interface org.apache.logging.log4j.core.LifeCycle

        getState, initialize, isStarted, isStopped
    • Method Detail

      • createAppender

        @PluginFactory
        public static EventHubsAppender createAppender​(@Required(message="Provide a Name for EventHubs Log4j Appender") @PluginAttribute("name")
                                                       String name,
                                                       @PluginElement("Filter")
                                                       org.apache.logging.log4j.core.Filter filter,
                                                       @PluginElement("Layout")
                                                       org.apache.logging.log4j.core.Layout<? extends Serializable> layout,
                                                       @PluginAttribute(value="ignoreExceptions",defaultBoolean=true)
                                                       boolean ignoreExceptions,
                                                       @Required(message="Provide EventHub connection string to append the events to") @PluginAttribute("eventHubConnectionString")
                                                       String connectionString,
                                                       @PluginAttribute(value="immediateFlush",defaultBoolean=false)
                                                       boolean immediateFlush)
      • append

        public void append​(org.apache.logging.log4j.core.LogEvent logEvent)
      • start

        public void start()
        Specified by:
        start in interface org.apache.logging.log4j.core.LifeCycle
        Overrides:
        start in class org.apache.logging.log4j.core.filter.AbstractFilterable
      • stop

        public void stop()
        Specified by:
        stop in interface org.apache.logging.log4j.core.LifeCycle
        Overrides:
        stop in class org.apache.logging.log4j.core.AbstractLifeCycle