Class RegexReplacement
java.lang.Object
org.apache.logging.log4j.core.pattern.RegexReplacement
@Plugin(name="Replace",
category="Core",
printObject=true)
public final class RegexReplacement
extends Object
Replace tokens in the LogEvent message.
-
Method Summary
Modifier and TypeMethodDescriptionstatic RegexReplacement
createRegexReplacement
(Pattern regex, String replacement) Create a RegexReplacement.Perform the replacement.toString()
-
Method Details
-
format
Perform the replacement.- Parameters:
msg
- The String to match against.- Returns:
- the replacement String.
-
toString
-
createRegexReplacement
@PluginFactory public static RegexReplacement createRegexReplacement(@PluginAttribute("regex") Pattern regex, @PluginAttribute("replacement") String replacement) Create a RegexReplacement.- Parameters:
regex
- The regular expression to locate.replacement
- The replacement value.- Returns:
- A RegexReplacement.
-