Package org.jboss.logmanager.filters
Class SubstituteFilter
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.
-
Field Summary
Fields -
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 TypeMethodDescriptionboolean
isLoggable
(LogRecord record) Apply the filter to the given log record.
-
Field Details
-
pattern
-
replacement
-
replaceAll
private final boolean replaceAll
-
-
Constructor Details
-
SubstituteFilter
Construct a new instance.- Parameters:
pattern
- the pattern to matchreplacement
- the string replacementreplaceAll
-true
if all occurrances should be replaced;false
if only the first occurrance
-
SubstituteFilter
Construct a new instance.- Parameters:
patternString
- the pattern to matchreplacement
- the string replacementreplaceAll
-true
if all occurrances should be replaced;false
if only the first occurrance
-
-
Method Details
-
isLoggable
Apply the filter to the given log record. Theformat style
will always be set toExtLogRecord.FormatStyle.NO_FORMAT
as the formatted message will be the one used in the replacement.- Specified by:
isLoggable
in interfaceFilter
- Parameters:
record
- the log record to inspect and modify- Returns:
true
always
-