scharff
v1.0.4
Published
Logger for outgoing requests
Downloads
9
Maintainers
Readme
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
- run
npm install scharff
. - fork the git repository
https://github.com/Minka1902/scharff.git
, and place it next to your project.
Usage
- in your entry point, import unregister from the package:
const { unregister } = require('scharff');
- to stop the logger just run the unregister function:
unregister()
, ornpm uninstall scharff
.
What to expect
- The package will create a outgoingRequest.log file and start logging the requests to the file.
- In there you can see the fetch requests you sent.
- 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
- New date log.
Requirements
- nodejs version >= v18.0.0
Future additions
- We will add a request error logger.
- We will add a response logger.
- We will add a response error logger.