RE: How do I use filters in AND condition fashion?

2003-11-20 Thread Mark Womack
Eric,

There are some filter classes in the log4j-sandbox cvs that you might want
to look at.

http://cvs.apache.org/viewcvs/jakarta-log4j-sandbox/src/java/org/apache/log4
j/filter/

MatchFilterBase.java is the base class for most of them and it allows
configuration for OR and AND type filter chains.  It can get a bit confusing
though.  Please take a look at and let me know if you can make heads or
tails of it.  If you have suggestions for making it clearer, or a better
design, I'd like to know.

thanks,
-Mark

 -Original Message-
 From: Eric Gravel [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, November 19, 2003 8:50 AM
 To: [EMAIL PROTECTED]
 Subject: How do I use filters in AND condition fashion?
 
 
 I've been looking at the sample code given in Ceki's Log4J 
 book, chapter
 6, and it seems that 
 if I had a filter chain such as the one below that it is a OR 
 condition
 type statement.  If there's
 a match on the first filter it accepts the message and stops 
 processing
 there.  If it doesn't match
 on the first one, it goes to the second filter and if there's a match
 there it stop as well.
 
 What I'd like to do is filter message on a condition such as all
 messages of level INFO and
 containing the text test for example.  Is this possible with the
 current distribution of log4j?
 
 
 filter class=org.apache.log4j.varia.LevelMatchFilter
   param name=LevelToMatch value=INFO /
   param name=AcceptOnMatch value=true /
 /filter
 
 filter class=org.apache.log4j.varia.StringMatchFilter
   param name=StringToMatch value=test /
   param name=AcceptOnMatch value=true /
 /filter
 
 
 
 Eric A. Gravel
 Java Programmer/Analyst - Internet Development
 
 Interval International
 6262 Sunset Drive, PH-1
 Miami, FL, 33143
 Office:  (305) 666-1861 x7315
 Fax:  (305) 668-3409
 Email:   [EMAIL PROTECTED]
 
 
 CONFIDENTIALITY NOTE
 This e-mail and any attached documentation is intended only 
 for the use of the individual or entity to which it is 
 addressed and may contain information that is privileged, 
 confidential, and exempt from disclosure. If any reader of 
 this message is not the intended recipient you are hereby 
 notified that any dissemination, distribution or copying of 
 this communication is strictly prohibited. If you have 
 received this communication in error, please notify the 
 sender immediately. Thank you.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How do I use filters in AND condition fashion?

2003-11-19 Thread Scott Deboy
I'm not sure about whether this capability is available using the latest
distribution's set of filters, but I've contributed a simple expression
language and an ExpressionFilter (should be a part of the next release)
which provide support for expressions using a number of operators,
grouping (parens), AND, OR and NOT operators, etc..  You will be able to
define an expression like:

( LEVEL == INFO )  ( MSG == TEST )

Hope this helps,
Scott

-Original Message-
From: Eric Gravel [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 19, 2003 8:50 AM
To: [EMAIL PROTECTED]
Subject: How do I use filters in AND condition fashion?


I've been looking at the sample code given in Ceki's Log4J book, chapter
6, and it seems that 
if I had a filter chain such as the one below that it is a OR condition
type statement.  If there's a match on the first filter it accepts the
message and stops processing there.  If it doesn't match on the first
one, it goes to the second filter and if there's a match there it stop
as well.

What I'd like to do is filter message on a condition such as all
messages of level INFO and containing the text test for example.  Is
this possible with the current distribution of log4j?


filter class=org.apache.log4j.varia.LevelMatchFilter
  param name=LevelToMatch value=INFO /
  param name=AcceptOnMatch value=true /
/filter

filter class=org.apache.log4j.varia.StringMatchFilter
  param name=StringToMatch value=test /
  param name=AcceptOnMatch value=true /
/filter



Eric A. Gravel
Java Programmer/Analyst - Internet Development

Interval International
6262 Sunset Drive, PH-1
Miami, FL, 33143
Office:  (305) 666-1861 x7315
Fax:  (305) 668-3409
Email:   [EMAIL PROTECTED]


CONFIDENTIALITY NOTE
This e-mail and any attached documentation is intended only for the use
of the individual or entity to which it is addressed and may contain
information that is privileged, confidential, and exempt from
disclosure. If any reader of this message is not the intended recipient
you are hereby notified that any dissemination, distribution or copying
of this communication is strictly prohibited. If you have received this
communication in error, please notify the sender immediately. Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How do I use filters in AND condition fashion?

2003-11-19 Thread Paul Smith
On Thu, 2003-11-20 at 05:16, Scott Deboy wrote:
 I'm not sure about whether this capability is available using the latest
 distribution's set of filters, but I've contributed a simple expression
 language and an ExpressionFilter (should be a part of the next release)
 which provide support for expressions using a number of operators,
 grouping (parens), AND, OR and NOT operators, etc..  You will be able to
 define an expression like:
 
 ( LEVEL == INFO )  ( MSG == TEST )

Hey Scott, is this in CVS yet?  I can't seem to locate it.  

cheers,

Paul


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How do I use filters in AND condition fashion?

2003-11-19 Thread Scott Deboy
Yes...currently in the varia package, although I understand Mark may be
planning a move to a new package for the filters.

By the way, since the expressionfilter relies on the rules we've been
working on, the rules should probably move out from under the chainsaw
package. 


-Original Message-
From: Paul Smith [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 19, 2003 2:14 PM
To: Log4J Users List
Subject: RE: How do I use filters in AND condition fashion?


On Thu, 2003-11-20 at 05:16, Scott Deboy wrote:
 I'm not sure about whether this capability is available using the 
 latest distribution's set of filters, but I've contributed a simple 
 expression language and an ExpressionFilter (should be a part of the 
 next release) which provide support for expressions using a number of 
 operators, grouping (parens), AND, OR and NOT operators, etc..  You 
 will be able to define an expression like:
 
 ( LEVEL == INFO )  ( MSG == TEST )

Hey Scott, is this in CVS yet?  I can't seem to locate it.  

cheers,

Paul


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How do I use filters in AND condition fashion?

2003-11-19 Thread Paul Smith
On Thu, 2003-11-20 at 09:17, Scott Deboy wrote:
 Yes...currently in the varia package, although I understand Mark may be
 planning a move to a new package for the filters.
 

Bizarre, I was doing a search from within Eclipse, and I could not find
it in the source, I must be going loopy.

 By the way, since the expressionfilter relies on the rules we've been
 working on, the rules should probably move out from under the chainsaw
 package. 

Yes, a good candidate for their own package under org.apache.log4j

thanks.

Paul


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]