koa-logger-bunyan

1.0.2 • Public • Published

Koa middleware for logging using bunya

Refer to

Ues

var koaLogger = require('koa-logger-bunyan');

app.use(koaLogger())

Else You want customize

var koaLogger = require('koa-logger-bunyan');

app.use(koaLogger({
  name: <string>,                     // Required
  level: <level name or number>,      // Optional, see "Levels" section
  stream: <node.js stream>,           // Optional, see "Streams" section
  streams: [<bunyan streams>, ...],   // Optional, see "Streams" section
  serializers: <serializers mapping>, // Optional, see "Serializers" section
  src: <boolean>,                     // 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

Todo

  • [x] customize
  • [ ] test

Package Sidebar

Install

npm i koa-logger-bunyan

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

7.38 kB

Total Files

5

Last publish

Collaborators

  • xuzihao