You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Craig Boland <cn...@sbcglobal.net> on 2006/06/21 17:44:49 UTC
Prevent logging messages that contain a string
I see that the StringMatchFilter logs messages that match StringToMatch or RegexToMatch properties, but is there a way to NOT log messages that match? Something like a DenyStringMatchFilter, perhaps?
The rule would be something like this: Log all messages _except_ those that match the filter.
Re: Prevent logging messages that contain a string
Posted by Cheng <ch...@gmail.com>.
try this:
<filter type="log4net.Filter.StringMatchFilter">
<param name="AcceptOnMatch" value="false" />
<param name="StringToMatch" value="text2match" />
</filter>
On 6/21/06, Craig Boland <cn...@sbcglobal.net> wrote:
>
> I see that the StringMatchFilter logs messages that match StringToMatch or
> RegexToMatch properties, but is there a way to NOT log messages that match?
> Something like a DenyStringMatchFilter, perhaps?
>
> The rule would be something like this: Log all messages _except_ those that
> match the filter.
>