Package org.jboss.logmanager.filters
Class SubstituteFilter
- java.lang.Object
-
- org.jboss.logmanager.filters.SubstituteFilter
-
- All Implemented Interfaces:
java.util.logging.Filter
public final class SubstituteFilter extends java.lang.Object implements java.util.logging.FilterA filter which applies a text substitution on the message if the nested filter matches.
-
-
Constructor Summary
Constructors Constructor Description SubstituteFilter(java.lang.String patternString, java.lang.String replacement, boolean replaceAll)Construct a new instance.SubstituteFilter(java.util.regex.Pattern pattern, java.lang.String replacement, boolean replaceAll)Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisLoggable(java.util.logging.LogRecord record)Apply the filter to the given log record.
-
-
-
Constructor Detail
-
SubstituteFilter
public SubstituteFilter(java.util.regex.Pattern pattern, java.lang.String replacement, boolean replaceAll)Construct a new instance.- Parameters:
pattern- the pattern to matchreplacement- the string replacementreplaceAll-trueif all occurrances should be replaced;falseif only the first occurrance
-
SubstituteFilter
public SubstituteFilter(java.lang.String patternString, java.lang.String replacement, boolean replaceAll)Construct a new instance.- Parameters:
patternString- the pattern to matchreplacement- the string replacementreplaceAll-trueif all occurrances should be replaced;falseif only the first occurrance
-
-
Method Detail
-
isLoggable
public boolean isLoggable(java.util.logging.LogRecord record)
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 interfacejava.util.logging.Filter- Parameters:
record- the log record to inspect and modify- Returns:
truealways
-
-