Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement automatic bug/crash report for ASP.NET web application?

Everyone probably notices that most modern applications nowadays has a way for user to send crash/bug report either automatically or with user permission. Some examples are Mozilla Crash Reporter or most Microsoft applications.

I really like this feature since it allows me to collect the bugs report quickly with helpful information than just let my user reports the bug/issue traditionally such as submit a help ticket.

I wonder if there is an easy or systematic way to implement that capability in ASP.NET web application.

Have you guys had any experience or knowledge to share for both WebForms and MVC applications? Or if this could be implemented in Client-side like JavaScript/JQuery, that'd be good.

Thanks!

like image 253
kimsk Avatar asked Jan 31 '09 23:01

kimsk


3 Answers

ASP.NET 2.0 introducted Health monitoring, which allows you to do this by just adding some stuff to the web.config. See: http://msdn.microsoft.com/en-us/library/ms998306.aspx

It can log to mail, sql, eventlog, etc. and allows you to set buffers. So it for example won't kill your mailserver if the sql database goes down or if some user discovers a bug and tries to call it too often a second :-)

You can also log failed authentication and app pool restarts with it, it's pretty usefull if you just need it working quick. It's still questionnable if it is the best solution to manage all the errors. Because it might not got all the information you need, for example browser version or smt like that.

like image 138
Erik Lieben Avatar answered Nov 01 '22 11:11

Erik Lieben


ELMAH is a library that plugs in and detects exceptions. You can also log an event yourself. The events and a great deal of data like url parameters and browser information can be emailed to administrators and optionally stored in a database for display. (Rather like an event log for the web site.) It doesn't have a built-in user form that I've seen, but can probably be extended to include such an option.

I've been using/customizing it for about two years now and it is really exceptional.

Another option might be to use Kampyle which includes a feedback box on the bottom right of your web site. You could use Javascript to trigger the box to appear if an issue is detected on the web site.

like image 4
DavGarcia Avatar answered Nov 01 '22 11:11

DavGarcia


For an ASP.NET applicatino--or any Web application for that matter--isn't this just a two-step process of:

  1. Logging the error (obviously); and
  2. Put a form on the error document to allow the user to enter feedback.

Or is there more to this?

like image 1
cletus Avatar answered Nov 01 '22 13:11

cletus