Logging the call stack?

Topics: Logging Application Block
Jan 10, 2007 at 2:07 AM
I need to include the call stack when creating a log entry, both to a text file and to the Windows Event Log. I don't seem to be able to find this functionality in the Logging Application Block, although it is available in the Exception Handling Application Block as part of the LoggingExceptionHandler.
Jan 15, 2007 at 4:26 PM
Normally you want the call stack for an exception, which is why the Exception Class has a StackTrace property.

If you want to add any custom properties to your logging output, you would use the ExtendedProperties Property of the LogEntry Class.

It allows you to add key-value pairs to the log output.

Check the documentation under Populating a Log Message with Additional Context Information within the Logging Application Block section.




David Hayden
Microsoft MVP C#