I should also point out that if you look at the documentation you will see that 
the default value for onMisMatch is “Deny”. So your first filter tests the log 
level and no matter what the level is it will discard the event.

Ralph

> On Aug 25, 2015, at 2:04 PM, Nicholas Duane <[email protected]> wrote:
> 
> I've tried a couple different combinations and so far no luck.  Here's 
> the current configuration I tested with which doesn't work:
> 
> <File ...>
>  <PatternLayout>
>      ...
>   </PatternLayout>
>   <Filters>
>      <ThresholdFilter level="INFO" onMatch="DENY"/>
>      <ThresholdFilter level="DEBUG" onMatch="ACCEPT"/>
>   </Filters>
> </File>
> 
> The
> use case for why I want such a filter is to forward a range of events 
> to an appender.  The threshold filter won't work because it will send 
> all events matching a certain level and lower to the appender.  For 
> instance, I might want all DEBUG, TRACE and VERBOSE events going to one 
> appender.  All INFO, ERROR and WARN events going to another appender.  
> All BUSINESS events (my custom) level, going to yet another appender.
> 
> Thanks,
> Nick
> 
>> Date: Tue, 25 Aug 2015 13:17:44 -0700
>> Subject: Re: range filter?
>> From: [email protected]
>> To: [email protected]
>> 
>> When you get it working, it sounds like it would make a nice addition to
>> the FAQ with a description of your use case.
>> 
>> Gary
>> 
>> On Tue, Aug 25, 2015 at 1:11 PM, Ralph Goers <[email protected]>
>> wrote:
>> 
>>> I believe two threshold filters inside a composite filter should should
>>> work provided you have the onMatch and onMismatch set appropriately.
>>> 
>>> Ralph
>>> 
>>> 
>>>> On Aug 25, 2015, at 12:36 PM, Nicholas Duane <[email protected]> wrote:
>>>> 
>>>> I'm looking for a range filter in log4j2.  I see there is on in log4net
>>> and it appears there was one written by someone for log4j 1.  Just
>>> wondering if there is something 'out of the box' in log4j2 that will
>>> accomplish the same?  I was wondering whether this could be accomplished
>>> with the CompositeFilter with two ThresholdFilter?
>>>> 
>>>> Thanks,
>>>> Nick
>>>> 
>>> 
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>> 
>>> 
>> 
>> 
>> -- 
>> E-Mail: [email protected] | [email protected]
>> Java Persistence with Hibernate, Second Edition
>> <http://www.manning.com/bauer3/>
>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>> Spring Batch in Action <http://www.manning.com/templier/>
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>                                         



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to