@gasket/plugin-morgan
TypeScript icon, indicating that this package has built-in type declarations

6.46.8 • Public • Published

@gasket/plugin-morgan

Adds the morgan request logger to your application.

Morgan is an HTTP request logger middleware for node.js.

Installation

Requirements

New apps

gasket create <app-name> --plugins @gasket/plugin-morgan

Existing apps

npm i @gasket/plugin-morgan

Modify plugins section of your gasket.config.js:

module.exports = {
  plugins: {
    add: [
      '@gasket/plugin-log',
+     '@gasket/plugin-morgan'
    ]
  }
}

Configuration

All the configurations for the plugin are added under morgan in the config:

  • format: The log format to print.
  • options: Morgan options.

See more format and options on Morgan middleware page.

Example configuration

Defaults:

module.exports = {
  plugins: {
    add: [
      '@gasket/plugin-log',
      '@gasket/plugin-morgan'
    ]
  },
  morgan: {
    format: 'tiny',
    options: {}
  }
}

How it works

This plugins hooks the [middleware] lifecycle from @gasket/plugin-express or @gasket/plugin-fastify, adding Morgan to format http requests to be logged using the [@gasket/plugin-logger].

License

MIT

Package Sidebar

Install

npm i @gasket/plugin-morgan

Weekly Downloads

167

Version

6.46.8

License

MIT

Unpacked Size

6.53 kB

Total Files

5

Last publish

Collaborators

  • bbetts
  • rxmarbles
  • ecarlson-godaddy
  • jpina1-godaddy
  • mmason2
  • kinetifex
  • 3rdeden
  • kawikabader