scharff

1.0.4 • Public • Published

Scharff Logger

Scharff is a lightweight and versatile Node.js package designed to enhance your application's logging capabilities by seamlessly integrating a powerful outgoing request logger. With Scharff, you can effortlessly gain insights into the interactions your application has with external services, APIs, and resources.

Installation

  1. run npm install scharff.
  2. fork the git repository https://github.com/Minka1902/scharff.git, and place it next to your project.

Usage

  1. in your entry point, import unregister from the package: const { unregister } = require('scharff');
  2. to stop the logger just run the unregister function: unregister(), or npm uninstall scharff.

What to expect

  1. The package will create a outgoingRequest.log file and start logging the requests to the file.
  2. In there you can see the fetch requests you sent.
  3. The request will be in the format below: {     "url":"http://666.777.888.999:3000/update/www.exampe.com",     "ip":"130.130.130.130",     "date":{         date:"20/20/2020",         time:"20:20:20 PM"     },     "originUrl":"/update/www.example.com",     "method":"PUT",     "headers":{         "Content-Type":"application/json",         "Access-Control-Allow-Origin":"*"     },     "body":{         "isActive":true,         "status":200,         "lastChecked":"2020-20-20T20:20:20.200Z"     } }

New in this release

  1. New date log.

Requirements

  1. nodejs version >= v18.0.0

Future additions

  1. We will add a request error logger.
  2. We will add a response logger.
  3. We will add a response error logger.

Package Sidebar

Install

npm i scharff

Weekly Downloads

1

Version

1.0.4

License

ISC

Unpacked Size

5.99 kB

Total Files

4

Last publish

Collaborators

  • minka1902