Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adherentman/koa-logger-bunyan
koa日志记录器的中间件 基于 bunyan
https://github.com/adherentman/koa-logger-bunyan
bunyan bunyan-logger koa-logger koa2 logger-middleware
Last synced: about 2 months ago
JSON representation
koa日志记录器的中间件 基于 bunyan
- Host: GitHub
- URL: https://github.com/adherentman/koa-logger-bunyan
- Owner: Adherentman
- Created: 2018-09-10T14:16:18.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-16T16:29:00.000Z (over 6 years ago)
- Last Synced: 2024-11-14T07:45:07.581Z (2 months ago)
- Topics: bunyan, bunyan-logger, koa-logger, koa2, logger-middleware
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/koa-logger-bunyan
- Size: 9.77 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Koa middleware for logging using bunya
## Refer to
- [bunyan-logger](https://github.com/koajs/bunyan-logger)
- [koa-json-logger](https://github.com/rudijs/koa-json-logger)## Ues
```javascript
var koaLogger = require('koa-logger-bunyan');app.use(koaLogger())
```Else You want customize
```javascript
var koaLogger = require('koa-logger-bunyan');app.use(koaLogger({
name: , // Required
level: , // Optional, see "Levels" section
stream: , // Optional, see "Streams" section
streams: [, ...], // Optional, see "Streams" section
serializers: , // Optional, see "Serializers" section
src: , // Optional, see "src" section// Any other fields are added to all log records as is.
foo: 'bar',
...
}))
```For specific use, please refer to https://github.com/trentm/node-bunyan.
## Result
![](https://blogaaaaxzh.oss-cn-hangzhou.aliyuncs.com/logger-bunyan.png)## Todo
- [x] customize
- [ ] test