micro-bunyan

1.0.1 • 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

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

2.99 kB

Total Files

4

Last publish

Collaborators

  • maximeshr