Logging Exceptions in Logging Application Block

Hey, I would like to know that when the .NET framework throws an exception and it is caught and then I log its Message only (Exception.Message), the LAB also logs the call stack with it. But when I throw an exception (not the .NET framework) it only logs
the Message and not the call stack. Can you tell me more about it? Can it be disabled/enabled.

I can't repro it on my end. Could you modify your template so that each part of the information is separated from the others? Like for the {timeStamp}, place the word "Timestamp" before it: TimeStamp: {timeStamp} and so on. I think
the one you think is stack trace is actually part of the Message property.

I can't repro it on my end. Could you modify your template so that each part of the information is separated from the others? Like for the {timeStamp}, place the word "Timestamp" before it: TimeStamp: {timeStamp} and so on. I think
the one you think is stack trace is actually part of the Message property.

Okay, I'm also unable to reproduce it. The issue was with my code to which I made a change yesterday and then forgot. Actually in the previous code I wanted to log the type of the exception so I used
Exception.ToString(), which includes the stack trace (Environment.StackTrace), so the stack trace was coming from there. But then I changed the code and the issue went away. So thanks for helping out.

Anyways is there an option in the LAB with which I can include the stack trace? A configurable such option, so I can enable/disable it when I want with re-compiling.

There is an overload of the Write method which allows you to pass an IDictionary<string, object>. If you want the stack trace to be included, create a Dictionary<string, object> and add a corresponding entry in there for the stack trace,
e.g.

One more thing I would like to know is that how may I insert new lines (empty lines) in the header and footer property of the Trace Listeners, I tried entering
'\r\n' without quotes but it printed \r\n and not empty lines.