1.0.3 • Published 6 years ago

@tng/ilog v1.0.3

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

TNG ilog 中间件

使用

yarn add @tng/ilog

require('@tng/ilog)({ name: 'Service Name' })

自定义client的解析函数

const ilog = require('@tng/ilog')

ilog({
  name: 'Client Name',
  ignoreRoutes: ['/version'], // 不打印日志的路由
  ignoreMethods: ['GET', 'OPTIONS'], // 默认是 ['OPTIONS']
  parseClientFunction: function (ctx) {
    if (_.result(ctx.state, 'consumer._id')) {
      return ctx.state.consumer.name + '_' + ctx.state.consumer.clientKey
    }
    return null
  }
})
1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago