3 ms·
We do this on a product page, but with some modifications. As luck would have it, I recently made a Gist about this :-) https://gist.github.com/2210783 https:/
by snprbob86 15y ago
We do this on a product page, but with some modifications. As luck would have it, I recently made a Gist about this :-)
https://gist.github.com/2210783 https://gist.github.com/2210783
Our approach integrates with a syslog-style logger. The logger preserves a ring buffer of messages, to help with debugging, since minified stack traces aren't super useful.
To mitigate the risk of a run-away infinite loop alert monster, alerts are intelligently rate limited client side. We also do server side filtering, so that known/expected errors are ignored. For example, we don't really care about Chrome extension-related failures, although I guess we might at some threshold for popular extensions.
It's relatively noisy, but so far it has been indispensable for debugging errors in production.
- dunham 15y agoWe've been doing this for a few years in our GWT app. We also keep a ring buffer of log events. We don't have much noise, but we're using GWT's "unhandled exception" hook which I believe is driven by try/catch blocks on all entry points into the app. (i.e. event handlers - I think they just wrap callbacks before hooking them up.) So we only get exceptions that occur in our own code. For us, the stacktraces are actually very useful (on the few browsers that provide traces). We dump a translation table from GWT's minification process and use it on the server side to de-obfuscate the stack traces. It works on all of the function/method names, but not local variable names. The new javascript "source maps" technology should provide enough information to do this with any minifier or compiler. I'd expect your favorite javascript minifier to start outputting source maps in the next few months.