Customize exception logging

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Customize exception logging

Lidstrom Daniel (SEIT)



I am currently using this format:


<layout type="log4net.Layout.PatternLayout">

<conversionPattern value="%date Level=%level Logger=%logger NDC=%property{NDC} %.10240message%newline" />



This is fine, however some exception stack traces cause the message to remove important information (the start of the message).

I am logging exceptions like this:


Log.WarnFormat("Lifecycle=TransientError Exception={0}", ex);


Is there a way to customize how exceptions are being logged?

For example, I would like to utilize this library to improve the stack traces:






General Information

The information contained in this e-mail message may be privileged, confidential, and protected from disclosure. Any unauthorized use, printing, copying, disclosure or dissemination of this communication may be subject to legal restriction or sanction. If you think that you have received this e-mail message in error, please reply to the sender and delete this message from your computer.