If you want ways to debug production code, there are a few things you can monitor:
- Capture window.onerror events.
- Create a JSON object to log important events on the page.
- If you're worried your site might be slow, use "new Date.getTime()" before/after a slow operation to get the time it took to run.
I don't know of ready-made tools for doing this. Generally people use an img tag to send a GET request back to their server, and then analyze the logs. Here's an example for logging JavaScript errors:
window.onerror = function(errorMsg, url, lineNumber) {
var url = '/js_err?msg=' + uriEncodeComponent(errorMsg) +
'&url=' + uriEncodeComponent(url) +
'&line=' + uriEncodeComponent(line);
var i = new Image();
i.src = url; // Sends GET request to /js_err with info
// Add some checks so that if above code throws an error, you won't
// ping your server in an infinite loop
}
Then you can look at requests to /js_err in your logs to see what the top error messages are, and combine with the user agent of the request to see what browsers the errors occur in.