Class PropertiesRewritePolicy
- java.lang.Object
-
- org.apache.logging.log4j.core.appender.rewrite.PropertiesRewritePolicy
-
- All Implemented Interfaces:
RewritePolicy
@Plugin(name="PropertiesRewritePolicy", category="Core", elementType="rewritePolicy", printObject=true) public final class PropertiesRewritePolicy extends Object implements RewritePolicy
This policy modifies events by replacing or possibly adding keys and values to the MapMessage.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PropertiesRewritePolicy
createPolicy(Configuration config, Property[] props)
Creates a PropertiesRewritePolicy.LogEvent
rewrite(LogEvent source)
Rewrites the event.String
toString()
-
-
-
Field Detail
-
LOGGER
protected static final Logger LOGGER
Allows subclasses access to the status logger without creating another instance.
-
-
Method Detail
-
rewrite
public LogEvent rewrite(LogEvent source)
Rewrites the event.- Specified by:
rewrite
in interfaceRewritePolicy
- Parameters:
source
- a logging event that may be returned or used to create a new logging event.- Returns:
- The LogEvent after rewriting.
-
createPolicy
@PluginFactory public static PropertiesRewritePolicy createPolicy(@PluginConfiguration Configuration config, @PluginElement("Properties") Property[] props)
Creates a PropertiesRewritePolicy.- Parameters:
config
- The Configuration.props
- key/value pairs for the new keys and values.- Returns:
- The PropertiesRewritePolicy.
-
-