Class DenyAllFilter

java.lang.Object
org.apache.log4j.spi.Filter
org.apache.log4j.filter.DenyAllFilter
All Implemented Interfaces:
org.apache.log4j.spi.OptionHandler

public class DenyAllFilter extends org.apache.log4j.spi.Filter
This filter drops all logging events.

You can add this filter to the end of a filter chain to switch from the default "accept all unless instructed otherwise" filtering behaviour to a "deny all unless instructed otherwise" behaviour.

Since:
0.9.0
  • Field Summary

    Fields inherited from class org.apache.log4j.spi.Filter

    ACCEPT, DENY, NEUTRAL, next
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    decide(org.apache.log4j.spi.LoggingEvent event)
    Always returns the integer constant Filter.DENY regardless of the LoggingEvent parameter.
    Deprecated.
    We now use JavaBeans introspection to configure components.
    void
    setOption(String key, String value)
    Deprecated.
    Use the setter method for the option directly instead of the generic setOption method.

    Methods inherited from class org.apache.log4j.spi.Filter

    activateOptions, getNext, setNext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DenyAllFilter

      public DenyAllFilter()
  • Method Details

    • getOptionStrings

      public String[] getOptionStrings()
      Deprecated.
      We now use JavaBeans introspection to configure components. Options strings are no longer needed.
      Returns null as there are no options.
    • setOption

      public void setOption(String key, String value)
      Deprecated.
      Use the setter method for the option directly instead of the generic setOption method.
      No options to set.
    • decide

      public int decide(org.apache.log4j.spi.LoggingEvent event)
      Always returns the integer constant Filter.DENY regardless of the LoggingEvent parameter.
      Specified by:
      decide in class org.apache.log4j.spi.Filter
      Parameters:
      event - The LoggingEvent to filter.
      Returns:
      Always returns Filter.DENY.