weblog
Introducing RSLog
Remote Script Logging (RSLog) is a MIT Licensed, light-weight, and easily customisable script which allows you to catch and trace JavaScript errors occuring on your users’ machines by logging them back to your web server.
It is completely unobtrusive, adds only one reference to the browser’s global namespace, and weighs in at just 660 bytes when minified. Check out the demo page.
Using RSLog
To use RSLog simply include the core JavaScript file near the top of your document and begin logging by executing RSLog.start().
Of course the script needs to talk to something on the server. This can be in what ever language most suits your needs, but I have created a very basic PHP script that logs to a text file. The simplest way to start using RSLog is to download the gzipped archive (containing the JavaScript, PHP, and log file) and unzip to your web server.
Options
The RSLog.start() method excepts one optional argument. This is an object of configuration parameters as shown below.
suppress- Boolean to suppress errors being passed to browsers default error handling. Default: trueurl- Full URL to send errors to. Default:/rslog/rslog.phpon current host.
Supported browsers
To remain unobtrusive the script uses the window.onerror event handler to catch errors. This event is only supported by IE 4+ and Gecko based browsers, including Firefox, Camino and Mozilla. It is not supported by Safari or Opera, so you won’t be able to catch errors specific to those browsers.
Comments:
Seems pretty useful. I'll probably give it a try as well.
Would you object if I made a Drupal module around this? [Drupal's a CMS which allows functionality to be added by "modules".]
To be included in the Drupal module archive, modules must be GPL licensed. MIT is apparently "GPL compatible", but that just means an MIT author's licensing decision can be parasitically embraced and extinguished by GPL. I'd rather respect and retain your licensing decision, so I'd dual license the module as "MIT or GPL".
If you feel that GPL is sufficiently abhorrent that you'd rather your stuff isn't included in a GPL'd module, I fully understand, and will release it only under the MIT license, from my homepage, rather than the official Drupal module archive.
If you'd rather that no Drupal module's distributed at all, I'm fine with that, too!
Add your comment:
Previous Posts
Latest Links
- Trumpet Quartet
- Bella Tromba this week recording at EMI with Kanye West.
- Are we designers or developers?
- I struggle with this one as well. My title at work is Software Engineer as well, which doesn't help matters.
- Dear W3C, Dear WaSP
- I'm not sure what I think about this. There seems to be a lot of general moaning about this stuff and not very much doing (with a few notable exceptions).
- The King of Web Standards
- Jeffrey Zeldman crowned by Business Week Magazine
- iPhone Javascript and spec benchmark
- Interesting JavaScript benchmarks on the new iPhone vs. Mac Book Pro

On 4 Apr 07
Bramus! (contact, colleague) said:
Going to give this one a spin. Surely will come in handy! Tnx!