[logback-dev] More than one filter in Appender

Ceki Gulcu ceki at qos.ch
Fri Apr 3 09:55:23 CEST 2009


Sure. Just declare multiple filters. Example:

   <appender class="...">
     <filter class="..."/>
     </filter>
     <filter class="..."/>
     </filter>
   </appender>

If you look at the AppenderBase base class in logback-core [1], there
is a method called addFilter(Filter). Joran, logback's configuration
framework, can deal with getters and setters as well as "adder"
methods. See the section entitled "Collection of Properties" in the
logback manual [2]. Essentially, the "adder" convention is useful for
dealing with a collection of properties, such as filters, instead of
just a single property.

[1] http://logback.qos.ch/xref/ch/qos/logback/core/AppenderBase.html
[2] http://logback.qos.ch/manual/onJoran.html

HTH,

boss134 wrote:
> is it possible to support more than one filter in Appender...? 

-- 
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch


More information about the logback-dev mailing list