All Implemented Interfaces:
Appender, Filterable, LocationAware, LifeCycle, LifeCycle2

@Plugin(name="Kafka", category="Core", elementType="appender", printObject=true) public final class KafkaAppender extends AbstractAppender
Sends log events to an Apache Kafka topic.
  • Method Details

    • createAppender

      @Deprecated public static KafkaAppender createAppender(Layout<? extends Serializable> layout, Filter filter, String name, boolean ignoreExceptions, String topic, Property[] properties, Configuration configuration, String key)
    • newBuilder

      @PluginBuilderFactory public static <B extends KafkaAppender.Builder<B>> B newBuilder()
      Creates a builder for a KafkaAppender.
      a builder for a KafkaAppender.
    • append

      public void append(LogEvent event)
      Description copied from interface: Appender
      Logs a LogEvent using whatever logic this Appender wishes to use. It is typically recommended to use a bridge pattern not only for the benefits from decoupling an Appender from its implementation, but it is also handy for sharing resources which may require some form of locking.
      event - The LogEvent.
    • start

      public void start()
      Description copied from class: AbstractFilterable
      Make the Filter available for use.
      Specified by:
      start in interface LifeCycle
      start in class AbstractFilterable
    • stop

      public boolean stop(long timeout, TimeUnit timeUnit)
      Description copied from class: AbstractFilterable
      Cleanup the Filter.
      Specified by:
      stop in interface LifeCycle2
      stop in class AbstractFilterable
      timeout - the maximum time to wait
      timeUnit - the time unit of the timeout argument
      true if the receiver was stopped cleanly and normally, false otherwise.
    • toString

      public String toString()
      toString in class AbstractAppender