HandlingInstanceID in XmlExceptionFormatter

Topics: Exception Handling Application Block, Logging Application Block
May 7, 2007 at 8:59 PM
I found this question on gotdotnet.com posted by philipwolfe and I need help with the same problem... Does anyone know why the HandlingInstanceID is prepended to the writer when using the XmlExceptionFormatter? Shouldn't it give it to the formatter to add to the writer? My formatter returns XML and the HandlingInstanceID is text outside of the XML. I am trying to create an XML-based exception log and the HandlingInstanceID is messing up the structure. Any ideas would be appreciated.

May 9, 2007 at 2:37 PM
The XmlExceptionFormatter probably just formats the exception itself and not any metadata attached to it like the HandlingInstanceID.

If you use the XMLTraceListener the entire output should be in XML Format.

Regards,

Dave

____________________________

David Hayden
Microsoft MVP C#
May 9, 2007 at 3:21 PM
Dave,

Thank you for your response.

I am a little confused with what you mean by using the XMLTraceListener. It doesn't actually show up in the Enterprise Library configuration utility as a Trace Listener.

I should also clarify how I set up my listener. I am using a Flat File Trace Listener to write the exception message to a text file. I am also using a Text Formatter with a Template that just displays the message. Judging from my configuration, it looks like the HandlingInstanceID is part of the message itself.

Jeff
May 9, 2007 at 4:18 PM
Dave,

I also forgot to mention that I am using Enterprise Library - January 2006 release.

Jeff