Howdy,
The parameter could be a comma-delimited string, which you could parse
with a StringTokenizer very easily.

But why are you doing this?

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Pitre, Russell [mailto:[EMAIL PROTECTED]
>Sent: Monday, January 12, 2004 9:33 AM
>To: Log4J Users List
>Subject: Custom Filter Question
>
>Hello all-
>
>
>
>I'm coding a simple filter that allows certain logger names to "pass
>through."  The filter works like this.  The filter checks the logger
>name by calling getLoggeName() method of the LoggingEvent class.  The
>parameter you supply such as "com.x.y" will check to see if the logger
>name starts with this value.  If the logger name starts with this
string
>it will return Filter.NEUTRAL else it will return Filter.DENY.  I want
>to be able supply multiple values to check for.  In a xml config file
>you would set up the filter like this.
>
>
>
><filter class="com.x.y.PassThrough">
>
>            <param name="Allow" value="com.x.y">
>
></filter>
>
>
>
>This will allow allow loggers that start with the name "com.x.y" to log
>there messages.  I want to be able to supply multiple values like
below.
>
>
>
><filter class="com.x.y.PassThrough">
>
>            <param name="Allow" value="com.x.y, com.a.b">
>
></filter>
>
>
>
>My question is, is it possible to supply multiple values like I have
>above.  If so, inside the custom filter you get this value by coding a
>method like so....how would I setup the "setAllow" method
below....would
>the parameter be a string array?
>
>
>
>==============================================
>
>public class PassThrough extends Filter {
>
>
>
>  string allow = "";
>
>
>
>  public int getAllow() {
>
>    return allow;
>
>  }
>
>  public void setAllow(string allow) {
>
>    this.allow = allow;
>
>  }
>
>public int decide(LoggingEvent event) {
>
>
>
>            String loggerName = event.getLoggerName()
>
>            if(loggerName.startsWith(allow))
>
>                        return Filter.Neutral;
>
>            }else{
>
>                        return Filter.DENY;
>
>}
>
>}
>
>}
>
>
>
>==============================================
>
>
>
>Many thanx
>
>Russ-
>
>
>
>




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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

Reply via email to