Skip to content

Request, response logger middleware using bunyan for micro framework. Also provides request<>response duration.

License

Notifications You must be signed in to change notification settings

maximeshr/micro-bunyan-request

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Request, response logger middleware using bunyan for micro framework. Also provides request<>response duration.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published