1.1.3 • Published 1 year ago

app-logs-collector v1.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Logger to catch web application logs in IndexedDB

IndexedDB Logger is a package which has capability to collect web application logs and store in Indexed DB of youe browser

The library app-logs-collector contains many facilities like collecting debug logs, error loga and download those logs in local csv file for reference

Commands

Install the app-logs-collctor library using below command

npm i app-logs-collector

Configuration

To use app-logs-collector in your application use below code

import { IndexedDB } from 'app-logs-collector'

// to add logs in error table
  const message = {
      location: document.location.href, // location of error filrname/url/component name
      error: {
        error: error.message, // error message
        url: error.url // url
      }
    };  
IndexedDB.getInstance().addToTable('error_logs', message);

// to add logs in debug table
  const message = {
      url: payload.url, // page url/component name
      type: type,
      method: payload.method ? payload.method : null, // request method
      responsePayload: JSON.stringify(payload.body) // response payload
    };
    IndexedDB.getInstance().addToTable('debug_logs', message);

// to download reports
IndexedDB.getInstance().getAllData('debug_logs'); // to download debug logs
IndexedDB.getInstance().getAllData('error_logs'); // to doenload error logs

Methods

addToTable(table_name, message) // to add log in table
getAllData(table_name) // to download data in csv
1.1.3

1 year ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

0.1.0

2 years ago