@Plugin(name="Kafka", category="Core", elementType="appender", printObject=true) public final class KafkaAppender extends AbstractAppender
Modifier and Type | Class and Description |
---|---|
static class |
KafkaAppender.Builder<B extends KafkaAppender.Builder<B>>
Builds KafkaAppender instances.
|
LifeCycle.State
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
ELEMENT_TYPE
Modifier and Type | Method and Description |
---|---|
void |
append(LogEvent event)
Logs a LogEvent using whatever logic this Appender wishes to use.
|
static KafkaAppender |
createAppender(Layout<? extends Serializable> layout,
Filter filter,
String name,
boolean ignoreExceptions,
String topic,
Property[] properties,
Configuration configuration,
String key)
Deprecated.
|
static <B extends KafkaAppender.Builder<B>> |
newBuilder()
Creates a builder for a KafkaAppender.
|
void |
start()
Make the Filter available for use.
|
boolean |
stop(long timeout,
TimeUnit timeUnit)
Cleanup the Filter.
|
String |
toString() |
error, error, error, getHandler, getLayout, getName, ignoreExceptions, parseInt, requiresLocation, setHandler, toSerializable
addFilter, getFilter, getPropertyArray, hasFilter, isFiltered, removeFilter, stop
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop
@Deprecated public static KafkaAppender createAppender(Layout<? extends Serializable> layout, Filter filter, String name, boolean ignoreExceptions, String topic, Property[] properties, Configuration configuration, String key)
@PluginBuilderFactory public static <B extends KafkaAppender.Builder<B>> B newBuilder()
public void append(LogEvent event)
Appender
event
- The LogEvent.public void start()
AbstractFilterable
start
in interface LifeCycle
start
in class AbstractFilterable
public boolean stop(long timeout, TimeUnit timeUnit)
AbstractFilterable
stop
in interface LifeCycle2
stop
in class AbstractFilterable
timeout
- the maximum time to waittimeUnit
- the time unit of the timeout argumentpublic String toString()
toString
in class AbstractAppender
Copyright © 1999-2021 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.