Utility that saves all javascript console logs into the IndexedDB database continuously. You can access console.* logs after the browser tab was closed. This utility is a good choice for developers that need to analyze web client logs after a time.
npm install logs2indexddb
l2i.setMaxRows(1000); // set max rows
l2i.on()
.then(() => {
console.log('one one')
console.info('two')
console.warn('three')
console.error('four')
});
// ...
console.log('5')
console.log('6')
Open test/console2db.html and look through the code and comments on the page. Also look into Javascript Console for errors (if occur).
To download a file with all logs from the database:
l2i.download();
To download a file with logs created today:
l2i.downloadToday();
To download logs for the given period use:
l2i.download(fromDate, toDate);
You can invoke it right from Javascript Console or attach to a button click event handler.
To clear old logs in the database:
l2i.clear();