You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Jeremy Whitlock <jc...@gmail.com> on 2005/10/31 22:01:23 UTC
Filter Based On Logging Class
Hey all,
I would like to implement a filter that would allow me to restrict messages
based on the class that is sending the LoggingEvent. So I could have
something like:
<filter class="my.filter.Class">
<param name="acceptOnMatch" value="false" />
<param name="expression" value="javax.naming org.jnp.server" />
</filter>
And the filter would not log any class that created a LoggingEvent if that
class was in either of those packages. Is there one of these available? If
not, how should I go about writing one? I do not see how I can get the class
from the LoggingEvent.
Take care,
Jeremy
Re: Filter Based On Logging Class
Posted by James Stauffer <st...@gmail.com>.
If you don't want anything from those paths to be logged you could
define loggers for them and set additivity to false.
On 10/31/05, Jeremy Whitlock <jc...@gmail.com> wrote:
> Hey all,
> I would like to implement a filter that would allow me to restrict messages
> based on the class that is sending the LoggingEvent. So I could have
> something like:
>
> <filter class="my.filter.Class">
> <param name="acceptOnMatch" value="false" />
> <param name="expression" value="javax.naming org.jnp.server" />
> </filter>
>
> And the filter would not log any class that created a LoggingEvent if that
> class was in either of those packages. Is there one of these available? If
> not, how should I go about writing one? I do not see how I can get the class
> from the LoggingEvent.
>
> Take care,
> Jeremy
>
>
--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org