Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/maximeshr/micro-bunyan-request
- Owner: maximeshr
- License: mit
- Created: 2018-03-01T10:21:01.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-03-01T10:32:18.000Z (over 6 years ago)
- Last Synced: 2024-07-07T09:21:40.400Z (4 months ago)
- Topics: bunyan, duration, http, logger, micro, request, response
- Language: JavaScript
- Size: 4.88 KB
- Stars: 3
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-micro - micro-bunyan-request - Request, response logger middleware using bunyan for micro framework. (Modules / HTTP Requests)
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