Routing different severities for the same category to different listeners

Topics: Logging Application Block
Sep 27, 2010 at 12:26 PM

I'm trying to allow business layer validation errors to be routed to a different listener from the business layer audit events.  I would prefer them to be the same category and I've tried to achieve this by assigning "Information" severity to the audit events and "Error" severity to the validation errors.  I then create two listeners, one "Business Audit" has an "Information" filter, the other "Business Errors" has an "Error" filter.  

This doesn't work as the "Information" filter is a minimum, and errors show up as well.

Any way I can get the listener severity filters to only exclude all but the selected value? 

It may be the same issue as this:




Sep 28, 2010 at 2:12 AM

There isn't any configurable item in Logging Application Block for this because the Filter property of trace listeners allows the value you select and everything else that's important.  To implement the behavior you want, you would need a custom trace listener for this.


Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.

Oct 27, 2010 at 3:58 PM

I've found out I didn't correctly understand the relationship between trace listener filters' SourceLevels and the log event's TraceEventType.  explains it.  I think I need to look again at the TraceEventType I am using, as bespoking the code looks like a difficult option.