Shorn,

If you look in the current log4j cvs (see
http://jakarta.apache.org/site/cvsindex.html), you will find a package named
org.apache.log4j.filters.  This package contains a current set of "useful"
filters that have been implemented for version 1.3; there are more to be
written yet.  You will probably be most interested in MDCMatchFilter.java.
Feel free to use any of them or use the code to write your own versions.
They are compatible with v1.2.X, they just won't see the "official" light of
day until v1.3.

If you have any feedback or suggestions for other "useful" filters, I'd like
to hear about it.

hth,
-Mark

> -----Original Message-----
> From: Shorn Tolley [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 23, 2002 5:11 PM
> To: [EMAIL PROTECTED]
> Subject: filtering messages by the MDC
> 
> 
> Hi folks,
> 
> I know there is a LevelMatchFilter, which can be used
> to only log if an event matches a given priority.
> 
> I know there is a StringMatchFilter, which can be used
> to only log if an event message matches a given
> string.
> 
> Is there a way for me to only log if the value
> associated with a particular key in the MDC matches a
> certain value?
> 
> If there's not, then I'm probably going to have to
> write one.  Can anyone see any obvious problems with
> this approach?  Or easier ways to do what I'm trying
> to do, that'd be even better :)
> 
> Cheers,
> Shorn.
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
<mailto:[EMAIL PROTECTED]>

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

Reply via email to