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.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic PropertiesRewritePolicy
createPolicy
(Configuration config, Property[] props) Creates a PropertiesRewritePolicy.Rewrites the event.toString()
-
Field Details
-
LOGGER
Allows subclasses access to the status logger without creating another instance.
-
-
Method Details
-
rewrite
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.
-
toString
-
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.
-