log entry restriction

Topics: Exception Handling Application Block, Logging Application Block
Feb 19, 2010 at 8:46 AM

Presently all the exceptions are logged to both trace file and database. I want to restrict certain exceptions to be logged to database and certain to trace.log file. How can this be done?

Feb 19, 2010 at 8:53 AM
Edited Feb 19, 2010 at 9:03 AM

Are you using logging in conjuction with the ExceptionHandling block?  If you are, create 2 exception policies 1 for each type of trace listener.  In each policy, add the exception types you want to be logged to that trace listener. 

If you're not using EHAB, create 2 categories, 1 for each type of trace listener.  Determine to which category you want to log based on the type of exception.

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com