7/31/2010
LifeCycle Solutions - Home ( the software development blog )
 

<April 2007>
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

Subscribe to this feed:

RSS 2.0 | Atom 1.0 |CDF

On this Page:
Client Error Logging





Wednesday, April 18, 2007

ASP.NET Health Monitoring is one of the more under-hyped features of ASP.NET.  It is a rich, flexible logging framework that can be used to log application events in a database, flat file, email, or custom source.  However, JavaScript errors, since they occur on the client-side, do not get the benefits of this framework.   Fortunately this can be fixed by linking the client to the server with a little Ajax.  James Newton-King has posted a great solution to do just this in ASP.NET. 

In this solution, a small script to capture errors from window.error is registered on the client.  These errors are wrapped in XML and sent to the server via XmlHttp.  On the server, an HttpHandler unwraps the XML and logs a Web Event for the exception- including browser information.  Viola!  Client-side errors in your application's event log.  This is extremely useful for debugging problem scripts and alerting you to problems in your application you may otherwise miss.

Posted by Daniel Root

© 2006 LifeCycle Solutions, LLC | All Rights Reserved