The StringMatchFilter is relatively simple. If you need to filter on the exception type and exception message then it should be trivial to write your own filter to do that. Just subclass the log4net.Filter.FilterSkeleton and in the Decide method peek at the loggingEvent.ExceptionObject. In your log4net config specify the filter type as the assembly qualified name (e.g. type="YourFilter, YourAssembly").
Nicko > -----Original Message----- > From: Baron Schwartz [mailto:[EMAIL PROTECTED] > Sent: 17 April 2005 23:34 > To: Log4NET User > Subject: RE: StringMatchFilter isn't rejecting log events > > It's in the exception's message. I guess that explains it. > Thanks for the help. > > Baron > > -- > Superstition brings bad luck. > > On Sun, 17 Apr 2005, Nicko Cadell wrote: > > > The StringMatchFilter only matches against the event message itself > > not other parts of the logging event. Where exactly are you passing > > 'FK_ListingCostByDay_Listing' into the log event? > > > > Nicko > > > >> -----Original Message----- > >> From: Baron Schwartz [mailto:[EMAIL PROTECTED] > >> Sent: 15 April 2005 16:09 > >> To: [email protected] > >> Subject: StringMatchFilter isn't rejecting log events > >> > >> Hi, > >> > >> We went over this recently on the list -- what am I doing > wrong? I'm > >> getting messages with the string "FK_ListingCostByDay_Listing" in > >> them. > >> Here's my config. Thanks in advance for your help! > >> > >> Baron > >> > >> <log4net> > >> <appender name="SmtpAppender" > >> type="log4net.Appender.SmtpAppender"> > >> .... [some stuff omitted] .... > >> <filter type="log4net.Filter.StringMatchFilter"> > >> <param name="AcceptOnMatch" value="false" /> > >> <param name="StringToMatch" > >> value="FK_ListingCostByDay_Listing" /> > >> </filter> > >> </appender> > >> <root> > >> <level value="ERROR" /> > >> <appender-ref ref="SmtpAppender" /> > >> </root> > >> > > > > > >
