Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/maximeshr/micro-bunyan-request

Request, response logger middleware using bunyan for micro framework. Also provides request<>response duration.
https://github.com/maximeshr/micro-bunyan-request

bunyan duration http logger micro request response

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

        

## 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](https://github.com/vvo/bunyan-request) for micro