I know, it sounds a little ridiculous (lol)......I'm working with Jboss
and I setup the console appender with a threshold value of debug.  I
have a "Scheduling" class that logs every 5 seconds what is in it's
queue.  And between Jboss and that scheduling class the console is a bit
cluttered.  So I only want to see debug statements that involve the
classes that I have written.  I'll eventually turn the filter off in
production.  

Does that make sense?

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


Man o' man....I wish I would think things through before I ask the list
for help  :)

Thanx Yaov-  

Russ  


-----Original Message-----
From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 12, 2004 9:34 AM
To: Log4J Users List
Subject: RE: Custom Filter Question


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]




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

Reply via email to