org.apache.log4j.varia
public class StringMatchFilter extends Filter
The filter admits two options StringToMatch and AcceptOnMatch. If there is a match between the value of the StringToMatch option and the message of the {@link org.apache.log4j.spi.LoggingEvent}, then the {@link #decide(LoggingEvent)} method returns {@link org.apache.log4j.spi.Filter#ACCEPT} if the AcceptOnMatch option value is true, if it is false then {@link org.apache.log4j.spi.Filter#DENY} is returned. If there is no match, {@link org.apache.log4j.spi.Filter#NEUTRAL} is returned.
Since: 0.9.0
Field Summary | |
---|---|
static String | ACCEPT_ON_MATCH_OPTION |
static String | STRING_TO_MATCH_OPTION |
Method Summary | |
---|---|
int | decide(LoggingEvent event)
Returns {@link Filter#NEUTRAL} is there is no string match. |
boolean | getAcceptOnMatch() |
String[] | getOptionStrings() |
String | getStringToMatch() |
void | setAcceptOnMatch(boolean acceptOnMatch) |
void | setOption(String key, String value) |
void | setStringToMatch(String s) |
Deprecated: Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term.
Deprecated: Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term.
Deprecated: We now use JavaBeans introspection to configure components. Options strings are no longer needed.
Deprecated: Use the setter method for the option directly instead
of the generic setOption
method.