micro-bunyan-request

1.0.2 • Public • Published

Usage

const bunyan = require('bunyan');
const bunyanRequest = require('micro-bunyan-request');

const logger = bunyan.createLogger({ name: 'My App' });
const logreq = bunyanRequest({
  logger: logger,
  headerName: 'x-request-id'
});

module.exports = logreq(async (req, res) => `Hello world`);

Credits

Adapted: vvo/bunyan-request for micro

Package Sidebar

Install

npm i micro-bunyan-request

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

3 kB

Total Files

4

Last publish

Collaborators

  • maximeshr