best way to log all details of an exception?

Topics: Logging Application Block
Apr 14, 2009 at 9:49 PM
I am pretty new to the logging application block.  What is the best way to ensure all details of an exception are logged?   Specifically, I am interested in Exception.StackTrace, Exception.Message, and Exception.Data.    Would be nice to include contextual information as well like Request.QueryString and Request.UserHostAddress as well.  Is there a good way to do this or do I just need to stuff all that stuff into extended props dictionary?   I didn't see any overloads on the Logger.LogEntry that just take in an Exception.

thanks


Apr 15, 2009 at 4:49 AM
Edited Apr 15, 2009 at 4:50 AM
Hi,

You can use the exception handling application block with a logging handler, the logging handler will log the exception message, stack trace and exception.data. For more details see this :  http://msdn.microsoft.com/en-us/library/dd139954.aspx

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com