How to Log Exception in a file?

Posted by Ismail on Stack Overflow See other posts from Stack Overflow or by Ismail
Published on 2010-06-07T12:25:20Z Indexed on 2010/06/07 12:32 UTC
Read the original article Hit count: 201

Filed under:
|
|

I want to be able to do logging in every catch block. Something like this.

catch (Exception exception)
{
  Logger.Write(exception);
}

and then the settings in the configuration will pick up the Message and StackTrace property etc using customer listener.

I would like to use Enterprise Library Logging Application Block. I'm sure someone must have done this already.

© Stack Overflow or respective owner

Related posts about c#

Related posts about logging