java.lang.Object
org.jboss.logmanager.filters.SubstituteFilter
- All Implemented Interfaces:
Filter
A filter which applies a text substitution on the message if the nested filter matches.
-
Constructor Summary
ConstructorsConstructorDescriptionSubstituteFilter(String patternString, String replacement, boolean replaceAll) Construct a new instance.SubstituteFilter(Pattern pattern, String replacement, boolean replaceAll) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisLoggable(LogRecord record) Apply the filter to the given log record.
-
Constructor Details
-
SubstituteFilter
Construct a new instance.- Parameters:
pattern- the pattern to matchreplacement- the string replacementreplaceAll-trueif all occurrences should be replaced;falseif only the first occurrence
-
SubstituteFilter
Construct a new instance.- Parameters:
patternString- the pattern to matchreplacement- the string replacementreplaceAll-trueif all occurrences should be replaced;falseif only the first occurrence
-
-
Method Details
-
isLoggable
Apply the filter to the given log record. Theformat stylewill always be set toExtLogRecord.FormatStyle.NO_FORMATas the formatted message will be the one used in the replacement.- Specified by:
isLoggablein interfaceFilter- Parameters:
record- the log record to inspect and modify- Returns:
truealways
-