1.3.1 • Published 3 months ago

@sliit-foss/http-logger v1.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

@sliit-foss/http-logger

Http logging middleware for Express.js

Installation

# using npm
npm install @sliit-foss/http-logger

# using yarn
yarn add @sliit-foss/http-logger

Usage

# using require
const httpLogger = require("@sliit-foss/http-logger");

# using import
import httpLogger from "@sliit-foss/http-logger";

Example

import app from "express";

app.use(httpLogger());

Usage With Options

import app from 'express';

app.use(httpLogger({
  whitelists: ["/public/*"] // An array of paths to exclude being logged if needed
  loggable: [
    "body"
  ], // An array of extra propeties in the request object to log. Defaults to the following: ['path', 'method', 'query', 'params']
}));

// or

app.use(httpLogger({
  whitelists: ["/public/*"],
  loggable: ({headers, body} => {
    // Pick the properties you want to log
    return {
      headers,
      body
    }
  }),
}));
1.3.1

3 months ago

1.3.0

3 months ago

1.2.2

4 months ago

1.2.0

4 months ago

1.2.1

4 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.1.0-blizzard.0

10 months ago

1.1.2

10 months ago

1.0.1

1 year ago

1.0.0

1 year ago