I want to catch and save an exception in log file.
How can I implement this myself?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should have a look at the NLog project : http://nlog-project.org/
Assuming you know how to catch an exception, you just need to log it with NLog, which has multiple configuration options to write the exception details (or a message) to file, event viewer, and so on.