@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, 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 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() |
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, setHandler, toSerializable, toString
addFilter, getFilter, getPropertyArray, hasFilter, isFiltered, removeFilter, stop
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop
public static final String STATIC_VARIABLES_KEY
@PluginBuilderFactory public static <B extends RoutingAppender.Builder<B>> B newBuilder()
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 void append(LogEvent event)
Appender
event
- The LogEvent.public Map<String,AppenderControl> getAppenders()
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 Configuration getConfiguration()
public ConcurrentMap<Object,Object> getScriptStaticVariables()
Copyright © 1999-2019 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.