jsErrLog is a self-contained service that captures the javascript error (so it doesn't scare the user) and sends the details back to the logging server so you can review (and resolve) the problem.
For Web developers you can think of it a light-weight javascript [Dr] Watson equivalent which gives you simple access to a limited set of SQM data.
jsErrLog is highly performant and is designed to fail gracefully - if there's a problem with the service it won't impact your application in any way.
Free, simple and fail-safe... and helps you deliver a better website. What more could you want?
You can find out more about jsErrLog via my blog posts or reach out via Twitter.
| Tweet |
|
|
<script type="text/javascript" src="http://jserrlog.appspot.com/jserrlog-min.js"></script>
<script type="text/javascript">
// Configure site parameters
//jsErrLog.debugMode = true;
// Optionally add additional debug information to the jsErrLog.info message field
//jsErrLog.info = "Populated the Info Message to pass to logger"
</script>
If you want the page to still throw javascript errors locally just set the debugMode to true and errors will be reported and then passed back to the browser.
At any time in your script you can update that value of the jsErrLog.info variable and that will be passed through to the report (note: it is truncated at 512 characters to protect the POST limit of 2048 characters)
If you already have your own error trapping logic that connects to the window.onerror event simply make sure it has been defined before you include the jserrlog.min.js file and after reporting the error the details will be passed to your existing handler.
If you want to see what the javascript is doing remove the -min and review jserrlog.js
If you deploy the script anywhere I'd love to know. Please get in touch with me via this blog post
But what if you don't want a report on-screen? Well, fear not. We expose an XML data feed for your reports. If you know the URL you can access it directly eg http://jserrlog.appspot.com/report.xml?sn=http://blog.offbeatmammal.com or simply click the "XML" link from the on-screen report. You can also request that the XML is formatted as RSS by adding the type=rss parameter eg http://jserrlog.appspot.com/report.xml?sn=http://blog.offbeatmammal.com&type=rss or clicking the "RSS" link from the on-screen report.
You can see samples of the types of errors trapped here and here.
If you deploy the script anywhere I'd love to know what you're using it for and how it's helped you.
| If you've found it useful would you consider supporting the service? |
For developers who just need a simple tool for testing in Chrome, you should check out the great jsError extension.
| jsErrLog is brought to you by an Offbeatmammal. If you've found it useful would you consider supporting the service? |