. A simple console.error override written in pure javascript.
Make sure you include errorLog.js in your page. Recommended as first file that loads. Set up the snippet to transport data back to you server.
bower install errorlog
npm install errorlog-browser
Callback that enables you to decorade the error object that is beeing collected.
By default this object will look like this :
var errorObj = {
title: errTitle,
lineColumn: errLineColumn[0],
windowHeight: windowHeight,
windowWidth: windowWidth,
os: os,
browser: browser,
url: url,
payload: errPayload
};
errorLogger.logger.onError = function (errorObj, originalError) { //do stuf here... }
You have to implement this method yourself. This snippet is completely agnostic to any transport. You have access to the collected errors in the
errorLogger.logger.logarray.
errorLogger.logger.send = function () { XHR(errorLogger.logger.log) }