1.1.4 • Published 9 months ago

node-requset-logger v1.1.4

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months 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

9 months ago

1.1.3

10 months ago

1.1.2

10 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago