Socket
Socket
Sign inDemoInstall

koa-logger-middleware

Package Overview
Dependencies
9
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    koa-logger-middleware

Koa2 middleware for logging requests using custom logger as winstonjs


Version published
Weekly downloads
5
Maintainers
1
Install size
4.22 MB
Created
Weekly downloads
 

Readme

Source

koa-logger-middleware

Koa logger middleware

Configuration

  • correlactionId: Boolean - add an correlactionId and set header X-Correlation-Id to it.
  • logger: Object - eg: winstonjs, by default is console with coloration.
    const winstonLogger = winston.createLogger({
      level: 'info',
      format: winston.format.json(),
      transports: [
        new winston.transports.Console({
          format: winston.format.simple(),
          colorize: true,
        })
      ]
    });
    
    logger({ logger: winstonLogger });
    

See the file index.js to see all options

License

MIT © YSO Corp

Keywords

FAQs

Last updated on 10 Mar 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc