@Plugin(name="Routing", category="Core", elementType="appender", printObject=true) public final class RoutingAppender extends AbstractAppender
| Modifier and Type | Class and Description |
|---|---|
static class |
RoutingAppender.Builder<B extends RoutingAppender.Builder<B>> |
LifeCycle.State| Modifier and Type | Field and Description |
|---|---|
static String |
STATIC_VARIABLES_KEY |
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGERELEMENT_TYPE| Modifier and Type | Method and Description |
|---|---|
void |
append(LogEvent event)
Logs a LogEvent using whatever logic this Appender wishes to use.
|
static RoutingAppender |
createAppender(String name,
String ignore,
Routes routes,
Configuration config,
RewritePolicy rewritePolicy,
PurgePolicy purgePolicy,
Filter filter)
Deprecated.
Since 2.7; use
newBuilder() |
void |
deleteAppender(String key)
Deletes the specified appender.
|
Map<String,AppenderControl> |
getAppenders()
Returns an unmodifiable view of the appenders created by this
RoutingAppender. |
Configuration |
getConfiguration() |
Route |
getDefaultRoute() |
AbstractScript |
getDefaultRouteScript() |
PurgePolicy |
getPurgePolicy() |
RewritePolicy |
getRewritePolicy() |
Routes |
getRoutes() |
ConcurrentMap<Object,Object> |
getScriptStaticVariables() |
static <B extends RoutingAppender.Builder<B>> |
newBuilder() |
void |
start()
Make the Filter available for use.
|
boolean |
stop(long timeout,
TimeUnit timeUnit)
Cleanup the Filter.
|
error, error, error, getHandler, getLayout, getName, ignoreExceptions, parseInt, requiresLocation, setHandler, toSerializable, toStringaddFilter, getFilter, getPropertyArray, hasFilter, isFiltered, removeFilter, stopequalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stoppublic static final String STATIC_VARIABLES_KEY
@PluginBuilderFactory public static <B extends RoutingAppender.Builder<B>> B newBuilder()
public void start()
AbstractFilterablestart in interface LifeCyclestart in class AbstractFilterablepublic boolean stop(long timeout,
TimeUnit timeUnit)
AbstractFilterablestop in interface LifeCycle2stop in class AbstractFilterabletimeout - the maximum time to waittimeUnit - the time unit of the timeout argumentpublic void append(LogEvent event)
Appenderevent - The LogEvent.public Map<String,AppenderControl> getAppenders()
RoutingAppender.
Note that this map does not contain appenders that are routed by reference.public void deleteAppender(String key)
key - The appender's key@Deprecated public static RoutingAppender createAppender(String name, String ignore, Routes routes, Configuration config, RewritePolicy rewritePolicy, PurgePolicy purgePolicy, Filter filter)
newBuilder()name - The name of the Appender.ignore - If "true" (default) exceptions encountered when appending events are logged; otherwise
they are propagated to the caller.routes - The routing definitions.config - The Configuration (automatically added by the Configuration).rewritePolicy - A RewritePolicy, if any.filter - A Filter to restrict events processed by the Appender or null.public Route getDefaultRoute()
public AbstractScript getDefaultRouteScript()
public PurgePolicy getPurgePolicy()
public RewritePolicy getRewritePolicy()
public Routes getRoutes()
public Configuration getConfiguration()
public ConcurrentMap<Object,Object> getScriptStaticVariables()
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.