Skip to content

Utility that saves all javascript console logs into the IndexedDB database continuously

Notifications You must be signed in to change notification settings

martianyi/logs2indexeddb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logs2indexeddb

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.

Install

npm install logs2indexddb

Example

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')

How to check that it works

Open test/console2db.html and look through the code and comments on the page. Also look into Javascript Console for errors (if occur).

Check logs after a while

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();

About

Utility that saves all javascript console logs into the IndexedDB database continuously

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 89.3%
  • HTML 10.7%