1.1.4 • Published 2 years ago

node-requset-logger v1.1.4

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

node-request-logger

node-request-logger is a middleware for logging incoming requests in an Express application. It provides a convenient way to log the details of each incoming request, including the method, URL, headers, and body.

Installation

Install the package using npm:

npm i node-requset-logger

Usage

Import the middleware in your Express application and use it as follows:

const express = require('express');
const requestLogger = require('node-request-logger');

const app = express();

// Use the request logger middleware
app.use(requestLogger);

// ... Define your routes and other middleware ...

// Start the server
app.listen(3000, () => {
  console.log('Server is listening on port 3000');
});

Options

The middleware accepts an optional options object as a parameter. The following options are available:

OptionTypeDescriptionDefault
logHeadersbooleanWhether to log the request headers.false
logBodybooleanWhether to log the request body.false
1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago