@Plugin(name="Rewrite", category="Core", elementType="appender", printObject=true) public final class RewriteAppender extends AbstractAppender
AbstractAppender.Builder<B extends AbstractAppender.Builder<B>>
LifeCycle.State
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
ELEMENT_TYPE, EMPTY_ARRAY
Modifier and Type | Method and Description |
---|---|
void |
append(LogEvent event)
Modifies the event and pass to the subordinate Appenders.
|
static RewriteAppender |
createAppender(String name,
String ignore,
AppenderRef[] appenderRefs,
Configuration config,
RewritePolicy rewritePolicy,
Filter filter)
Creates a RewriteAppender.
|
boolean |
requiresLocation() |
void |
start()
Make the Filter available for use.
|
error, error, error, getHandler, getLayout, getName, ignoreExceptions, parseInt, setHandler, toSerializable, toString
addFilter, getFilter, getPropertyArray, hasFilter, isFiltered, removeFilter, stop, stop
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop
public void start()
AbstractFilterable
start
in interface LifeCycle
start
in class AbstractFilterable
public void append(LogEvent event)
event
- The LogEvent.@PluginFactory public static RewriteAppender createAppender(@PluginAttribute(value="name") String name, @PluginAttribute(value="ignoreExceptions") String ignore, @PluginElement(value="AppenderRef") AppenderRef[] appenderRefs, @PluginConfiguration Configuration config, @PluginElement(value="RewritePolicy") RewritePolicy rewritePolicy, @PluginElement(value="Filter") Filter filter)
name
- The name of the Appender.ignore
- If "true"
(default) exceptions encountered when appending events are logged; otherwise
they are propagated to the caller.appenderRefs
- An array of Appender names to call.config
- The Configuration.rewritePolicy
- The policy to use to modify the event.filter
- A Filter to filter events.public boolean requiresLocation()
requiresLocation
in interface LocationAware
requiresLocation
in class AbstractAppender
Copyright © 1999-2023 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.