How Logger.Write() writes the exception object?

Topics: Logging Application Block
Apr 8, 2014 at 10:40 PM
Edited Apr 9, 2014 at 3:37 AM
the overloaded Logger.Write() method takes object as a parameter. If i pass System.Exception instance as parameter How logging framework will log the exception?
1>Will it serialize the exception and log?
2>How data property of the exception will get serialized since its IDictionary?
3>Will it recursively log all the inner exceptions along with stack trace?
catch(Exception ex)
Apr 11, 2014 at 12:56 PM
Logger.Write(object) will call ToString() on any object passed in -- there is no custom handling for different types.

If you are using the Exception Handling Block Logging Handler then the exception will be formatted (Data items logged as ExtendedProperties and all inner exceptions included as well).

Randy Levy
Enterprise Library support engineer
Support How-to