@Plugin(name="MapRewritePolicy", category="Core", elementType="rewritePolicy", printObject=true) public final class MapRewritePolicy extends Object implements RewritePolicy
Modifier and Type | Class and Description |
---|---|
static class |
MapRewritePolicy.Mode
An enumeration to identify whether keys not in the MapMessage should be added or whether only existing
keys should be updated.
|
Modifier and Type | Field and Description |
---|---|
protected static org.apache.logging.log4j.Logger |
LOGGER
Allow subclasses access to the status logger without creating another instance.
|
Modifier and Type | Method and Description |
---|---|
static MapRewritePolicy |
createPolicy(String mode,
KeyValuePair[] pairs)
The factory method to create the MapRewritePolicy.
|
LogEvent |
rewrite(LogEvent source)
Rewrite the event.
|
String |
toString() |
protected static final org.apache.logging.log4j.Logger LOGGER
public LogEvent rewrite(LogEvent source)
rewrite
in interface RewritePolicy
source
- a logging event that may be returned or
used to create a new logging event.@PluginFactory public static MapRewritePolicy createPolicy(@PluginAttribute(value="mode") String mode, @PluginElement(value="KeyValuePair") KeyValuePair[] pairs)
mode
- The string representation of the Mode.pairs
- key/value pairs for the new Map keys and values.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.