1.0.9 • Published 6 months ago

coojar-logger v1.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

Coojar Logger is a versatile Node.js middleware package designed to streamline request/response logging, header masking, and error handling within HTTP servers.

Features

  • Header Masking: Conceals sensitive headers in incoming and outgoing HTTP requests.
  • Request/Response Logging: Captures and logs request and response details, including method, URL, duration, status code, and masked headers.
  • Error Handling: Logs errors occurring during request processing.
  • Flexible Configuration: Easy integration and customizable options.

Installation

Install the package via npm:

npm install coojar-logger

Usage

const middlewareLogger = require('coojar-logger');

// ...your existing middleware stack setup

// Add middlewareLogger to your stack
app.use(middlewareLogger());

Example

const express = require('express');
const middlewareLogger = require('coojar-logger');

const app = express();

// Add middlewareLogger to your Express app
app.use(middlewareLogger());

// ...other middleware and routes

const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
  console.log(`Server running on port ${PORT}`);
});

Configuration Options

The middleware supports configuration through options, although the default setup works seamlessly for most cases.

Author

Chibuzor

https://github.com/chibuzc

1.0.9

6 months ago

1.0.8

6 months ago

1.0.7

6 months ago

1.0.6

6 months ago

1.0.5

11 months ago

1.0.4

11 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