Link to home
Start Free TrialLog in
Avatar of lapucca
lapucca

asked on

What is the best way to handle run time errors for a web application?

Hi, I'm using vs2012, asp.net and C#.
Can you suggest or provide url for best practice nowadays to handle run time errors.  I have try catch block.  What's best to do when my application lands in the Catch block.  The best practice on how to log the error or any action I should take.  How to display errors to users.

Thank you.
SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lapucca
lapucca

ASKER

I forgot to mention this is a Intranet web application.  I was thinking about sending out an email and also logging to Window's application event log.  

Can you recommend a a good url/article on how to redirect to an error message?
Thank you.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lapucca

ASKER

Hi Sud,
Those are great suggestions.  I've been searching the internet for some documentation on how to use ELMAH and how it logs but haven't sound it. Would you happen to know where is the documentation?  Also, does it only log to database or is there an option to log to Window's application Event log?  I was also looking at "Enterprise Library - Loggin Application" in Nuget and that one seems to offer options for loggin to different destination.  Do you recommend one over the other?   Thank you.
Avatar of lapucca

ASKER

Okay, I found the site, https://code.google.com/p/elmah/ 
However, it looks like quite a setup for database.  I wonder if it's easier just using the Enterprise Library logging to log into the web server's window's application log?
Avatar of lapucca

ASKER

I decided to go with Enterprise Library Logging block from MS.  I need to learn about using EL too.  thank you.