Connecting Exception Management to Logging with "extras"

Topics: Building and extending application blocks, Exception Handling Application Block, Logging Application Block
Jun 25, 2008 at 2:36 AM
I have a custom trace listener for use in logging.  This works well when using the Logger.Write API since I can use the ExtendedProperties property on the LogEntry to pass any "extra" information that might be needed by the custom trace listener.

However, when utilizing this trace listener as a logger from the Exception Handling block I'm not able to figure out how to pass those "extras" when using the ExceptionPolicy.HandleException(...).

I want to take advantage of the ExceptionPolicy configuration (what to do for what exceptions for what policies) but also need to utilize the logging block that requires custom inputs as well.

Does anyone have any ideas on this?

Thanks,
Kevin
Jun 25, 2008 at 3:00 AM

Exception.Data

Chester

Jun 25, 2008 at 3:17 AM
Edited Jun 25, 2008 at 3:38 AM
Thanks!!

Using ex.Data.Add(key, value) seems to work great.

Thanks,
Kevin