Save This Page
Home » apache-log4j-1.2.15 » org.apache » log4j » varia » [javadoc | source]
org.apache.log4j.varia
public class: StringMatchFilter [javadoc | source]
java.lang.Object
   org.apache.log4j.spi.Filter
      org.apache.log4j.varia.StringMatchFilter

All Implemented Interfaces:
    OptionHandler

This is a very simple filter based on string matching.

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 org.apache.log4j.spi.LoggingEvent , then the #decide(LoggingEvent) method returns org.apache.log4j.spi.Filter#ACCEPT if the AcceptOnMatch option value is true, if it is false then org.apache.log4j.spi.Filter#DENY is returned. If there is no match, org.apache.log4j.spi.Filter#NEUTRAL is returned.

Field Summary
public static final  String STRING_TO_MATCH_OPTION   
     
    public static final  String ACCEPT_ON_MATCH_OPTION   
       
       boolean acceptOnMatch     
       String stringToMatch     
      Fields inherited from org.apache.log4j.spi.Filter:
      next,  DENY,  NEUTRAL,  ACCEPT
      Method from org.apache.log4j.varia.StringMatchFilter Summary:
      decide,   getAcceptOnMatch,   getOptionStrings,   getStringToMatch,   setAcceptOnMatch,   setOption,   setStringToMatch
      Methods from org.apache.log4j.spi.Filter:
      activateOptions,   decide,   getNext,   setNext
      Methods from java.lang.Object:
      equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
      Method from org.apache.log4j.varia.StringMatchFilter Detail:
       public int decide(LoggingEvent event) 
       public boolean getAcceptOnMatch() 
       public String[] getOptionStrings() 
      Deprecated! We - now use JavaBeans introspection to configure components. Options strings are no longer needed.

       public String getStringToMatch() 
       public  void setAcceptOnMatch(boolean acceptOnMatch) 
       public  void setOption(String key,
          String value) 
      Deprecated! Use - the setter method for the option directly instead of the generic setOption method.

       public  void setStringToMatch(String s)