You can use parens for grouping and then use ands and ors:

<param name="Expression" value="( LOGGER ~= class1 &amp;&amp; MSG ~= test1 )
|| ( logger ~= class2 &amp;&amp; MSG ~= TEST2 )"/>

With the latest release of extras you don't need spaces around parens,
operators or keywords, but I added them for readability.

Scott

On Fri, Nov 26, 2010 at 5:11 PM, Tech Newbie <[email protected]> wrote:

> Is it possible to define multiple expressions in one single
> ExpressionFilter?  For example, I want to filter out two different texts in
> two different classes but this doesn't work.  Only the 2nd definition takes
> effect.
>
> <filter class="org.apache.log4j.filter.ExpressionFilter">
>   <param name="Expression" value="LOGGER ~= class1 && MSG ~= test1"/>
>   <param name="Expression" value="LOGGER ~= class2 && MSG ~= test2"/>
>   <param name="AcceptOnMatch" value="false"/>
> </filter>
>
> I have to separate them out in their individual <filter> element.
>
>
>
>
>

Reply via email to