I doubt there is much of a difference - that's something you would need to measure for yourself to answer.
Scott On Mon, Nov 29, 2010 at 8:38 AM, Tech Newbie <[email protected]> wrote: > Thanks. Is there any performance differences if I put multiple expressions > in one ExpressionFilter using using () as you described: > <filter class="org.apache.log4j.filter.ExpressionFilter"> > > <param name="Expression" value=" ( LOGGER ~= class1 && MSG ~= test1" ) > || > > ( LOGGER ~= class2 && MSG ~= test2") /> > > <param name="AcceptOnMatch" value="false"/> > > </filter> > > > versus using multiple ExpressionFilter sections, each with one expression: > <filter class="org.apache.log4j.filter.ExpressionFilter"> > <param name="Expression" value="LOGGER ~= class1 && MSG ~= test1"/> > <param name="AcceptOnMatch" value="false"/> > </filter> > <filter class="org.apache.log4j.filter.ExpressionFilter"> > > <param name="Expression" value="LOGGER ~= class2 && MSG ~= test2"/> > > <param name="AcceptOnMatch" value="false"/> > > </filter> > > > Thanks again. > > --- On Sat, 11/27/10, Scott Deboy <[email protected]> wrote: > > From: Scott Deboy <[email protected]> > Subject: Re: Multiple expressions define in one ExpressionFilter? > To: "Log4J Users List" <[email protected]> > Date: Saturday, November 27, 2010, 3:44 AM > > You can use parens for grouping and then use ands and ors: > > <param name="Expression" value="( LOGGER ~= class1 && MSG ~= test1 ) > || ( logger ~= class2 && 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. > > > > > > > > > > > > > > >
