If I am just logging exception details in my web app, do I really need to put in exception handling logic for each tier? Why not just let them all bubble up the stack trace to the global.asax and log them there?
Share
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.
I would suggest against using any exception handling logic in any layer of your application unless:
Of course, exceptions – whether they are fatal or not or should be "ignored" or not – need to be logged and developers notified. This is best handled through an event handler for the
Application.Errorevent. Yes, this can be done inGlobal.asax, but I think it’s cleaner to use an HTTP Module-based approach, either Health Monitoring or ELMAH.I’ve written an article on this topic that I’d like to recommend to you – Exception Handling Advice for ASP.NET Web Applications. Here is the article in summary: