public final class SubstituteFilter
extends java.lang.Object
implements java.util.logging.Filter
Modifier and Type | Field and Description |
---|---|
private java.util.regex.Pattern |
pattern |
private boolean |
replaceAll |
private java.lang.String |
replacement |
Constructor and Description |
---|
SubstituteFilter(java.util.regex.Pattern pattern,
java.lang.String replacement,
boolean replaceAll)
Construct a new instance.
|
SubstituteFilter(java.lang.String patternString,
java.lang.String replacement,
boolean replaceAll)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isLoggable(java.util.logging.LogRecord record)
Apply the filter to the given log record.
|
private final java.util.regex.Pattern pattern
private final java.lang.String replacement
private final boolean replaceAll
public SubstituteFilter(java.util.regex.Pattern pattern, java.lang.String replacement, boolean replaceAll)
pattern
- the pattern to matchreplacement
- the string replacementreplaceAll
- true
if all occurrances should be replaced; false
if only the first occurrancepublic SubstituteFilter(java.lang.String patternString, java.lang.String replacement, boolean replaceAll)
patternString
- the pattern to matchreplacement
- the string replacementreplaceAll
- true
if all occurrances should be replaced; false
if only the first occurrancepublic boolean isLoggable(java.util.logging.LogRecord record)
format style
will always be set to ExtLogRecord.FormatStyle.NO_FORMAT
as the formatted
message will be the one used in the replacement.isLoggable
in interface java.util.logging.Filter
record
- the log record to inspect and modifytrue
always