Class RegexFilter.Builder
java.lang.Object
org.apache.logging.log4j.core.filter.AbstractFilter.AbstractFilterBuilder<RegexFilter.Builder>
org.apache.logging.log4j.core.filter.RegexFilter.Builder
- All Implemented Interfaces:
Builder<RegexFilter>
- Enclosing class:
- RegexFilter
public static final class RegexFilter.Builder
extends AbstractFilter.AbstractFilterBuilder<RegexFilter.Builder>
implements Builder<RegexFilter>
A
RegexFilter builder instance.- Since:
- 2.27.0
-
Field Summary
Fields inherited from class org.apache.logging.log4j.core.filter.AbstractFilter.AbstractFilterBuilder
ATTR_ON_MATCH, ATTR_ON_MISMATCH -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns aRegexFilterinstance configured by this builder.booleanisValid()Validates that the builder is properly configured to build.Sets the regular-expression.setUseRawMsg(boolean useRawMsg) Sets the use raw msg flag.Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilter.AbstractFilterBuilder
asBuilder, getOnMatch, getOnMismatch, setOnMatch, setOnMismatchMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.logging.log4j.core.util.Builder
getErrorPrefix
-
Method Details
-
setRegex
Sets the regular-expression.- Parameters:
regex- the regular-expression- Returns:
- this builder
-
setUseRawMsg
Sets the use raw msg flag.- Parameters:
useRawMsg-trueif the message format-patter/field will be used as match target; otherwise,false- Returns:
- this builder
-
isValid
public boolean isValid()Validates that the builder is properly configured to build.- Specified by:
isValidin interfaceBuilder<RegexFilter>- Returns:
trueif the builder configuration is valid; otherwise,false
-
build
Builds and returns aRegexFilterinstance configured by this builder.- Specified by:
buildin interfaceBuilder<RegexFilter>- Returns:
- the created
RegexFilterornullif the builder is misconfigured
-