Return-Path: Delivered-To: apmail-logging-log4net-user-archive@www.apache.org Received: (qmail 9590 invoked from network); 21 Jul 2008 18:28:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Jul 2008 18:28:01 -0000 Received: (qmail 53609 invoked by uid 500); 21 Jul 2008 18:27:59 -0000 Delivered-To: apmail-logging-log4net-user-archive@logging.apache.org Received: (qmail 53593 invoked by uid 500); 21 Jul 2008 18:27:59 -0000 Mailing-List: contact log4net-user-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Log4NET User" List-Id: Delivered-To: mailing list log4net-user@logging.apache.org Received: (qmail 53582 invoked by uid 99); 21 Jul 2008 18:27:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jul 2008 11:27:59 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of alexander.wolff@gmail.com designates 209.85.132.240 as permitted sender) Received: from [209.85.132.240] (HELO an-out-0708.google.com) (209.85.132.240) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jul 2008 18:27:06 +0000 Received: by an-out-0708.google.com with SMTP id c28so404281ana.104 for ; Mon, 21 Jul 2008 11:27:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:in-reply-to:mime-version:content-type:references :x-google-sender-auth; bh=mgGSKrkXjtoETt3AoAToP8RHr1DD7XqmHTo9pBQcdgo=; b=rIODOdUTY923kaJWaOk9D585Ie/3vOgfEcu2n864I/btFn90dTpd+UeKlj/aMBVluR HHTvADgXCMi/EroQtC3JPJyS4WH34jTSozPv/BAyDsxNtYicUIv/dZ7vo96+8/XY0Yki UzxnCLejNew2TL/xypOBqstGfwlvndzLv/mSE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version :content-type:references:x-google-sender-auth; b=HpJ9vzS5mi78VJyFjgUWXNpywJM4UnRoiJ56XxMd1Ywl9YUT5yGt8BFSL8DFXDLCf0 S6NGYl7EXy04sq6+GRSCkHYzdzu21aVOGF7+91AlOYayP/XywV9ycvvIwUIDku0vwl3i KUxRExvILTHnG2ggH+hfjQdku2nO8q+6V4k94= Received: by 10.100.41.1 with SMTP id o1mr1913908ano.10.1216664850862; Mon, 21 Jul 2008 11:27:30 -0700 (PDT) Received: by 10.100.225.8 with HTTP; Mon, 21 Jul 2008 11:27:30 -0700 (PDT) Message-ID: Date: Mon, 21 Jul 2008 15:27:30 -0300 From: "Alexander Wolff" Sender: alexander.wolff@gmail.com To: "Log4NET User" Subject: Re: how to configure a "deny stringmatch filter" In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_96628_7814410.1216664850841" References: X-Google-Sender-Auth: 9dc4730be6d1a493 X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_96628_7814410.1216664850841 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I tried but... To be concrete, which I need is not to record in the log file (Im using FileAppender in this case) messages which contain string "ORA-00001" Then I tried with the following filter: But..errors messages with "ORA-00001" are logged :( Peculiarly, with the following filter: Only messages that contain the string "ORA-00001" are logged (OK, it's the behavior that I would hope) And with the following filter: No message is recorded in log (OK, it's the behavior that I would hope) Some Idea? 2008/7/20 Daniel Williams : > I believe this will work: > > > > > > > > If not this exactly, then search for acceptOnMatch and see what the > right settings are. > > Cheers, > Daniel Williams > > On Sat, Jul 19, 2008 at 10:55 PM, Alexander Wolff > wrote: > > the following filter: > > > > > > > > > > > > Look for the substring 'database' in the message text of the event, in > the > > case that text is found the filter is ACCEPTED and the message is logged. > OK > > > > I want to configure a filter that DENY the substring 'database' (don't > log > > the message) > > > > how can I configure that? > > > > thanks in advance, > > Alexander Wolff > > > ------=_Part_96628_7814410.1216664850841 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
I tried but...

To be concrete, which I need is not to record in the log file (Im using FileAppender in this case) messages which contain string "ORA-00001"

Then I tried with the following filter:

        <filter type="log4net.Filter.StringMatchFilter">
            <acceptOnMatch value="false" />
            <stringToMatch value="ORA-00001" />
        </filter>

But..errors messages with "ORA-00001" are logged :(

Peculiarly, with the following filter:

        <filter type="log4net.Filter.StringMatchFilter">
            <acceptOnMatch value="true" />
            <stringToMatch value="ORA-00001" />
        </filter>
        <filter type="log4net.Filter.DenyAllFilter" />

Only messages that contain the string "ORA-00001" are logged (OK, it's the behavior that I would hope)

And with the following filter:

        <filter type="log4net.Filter.StringMatchFilter">
            <acceptOnMatch value="false" />
            <stringToMatch value="ORA-00001" />
        </filter>
        <filter type="log4net.Filter.DenyAllFilter" />

No message is recorded in log (OK, it's the behavior that I would hope)

Some Idea?


2008/7/20 Daniel Williams <dlwiii@gmail.com>:
I believe this will work:

<filter type="log4net.Filter.StringMatchFilter">
   <stringToMatch value="database" />
   <acceptOnMatch="false"/>
</filter>
<filter type="denyAllFilter"/>

If not this exactly, then search for acceptOnMatch and see what the
right settings are.

Cheers,
Daniel Williams

On Sat, Jul 19, 2008 at 10:55 PM, Alexander Wolff
<awolff@concepto.com.uy> wrote:
> the following filter:
>
> <filter type="log4net.Filter.StringMatchFilter">
>     <stringToMatch value="database" />
> </filter>
>
> Look for the substring 'database' in the message text of the event, in the
> case that text is found the filter is ACCEPTED and the message is logged. OK
>
> I want to configure a filter that DENY the substring 'database' (don't log
> the message)
>
> how can I configure that?
>
> thanks in advance,
> Alexander Wolff
>

------=_Part_96628_7814410.1216664850841--