Introducing RSLog

25 March 2007

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.


The RSLog.start() method excepts one optional argument. This is an object of configuration parameters as shown below.

RSLog.start( { suppress: false, url: '' } )    

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.