1.0.3 • Published 5 months ago

egg-qr-log v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

header/tracid透传

// app.js 
async didReady() {
    this.app.httpclient.on('request', (req) => {
      // 可以在这里设置一些 trace headers,方便全链路跟踪
      req.args.headers = transHeader(req.ctx, req.args.headers || {})
    })
}

日志

  // extend/context.js  
  const {getLog, logId} = require('pazl-log');

  let options = {
    appName: 'node-katyusha-frontend-manage',   // app名称
    service: 'node-katyusha-frontend-manage',   // 服务名
    loggerName: 'egg-logger',   // 日志名称
    appTeam:'front-end',        // 团队名称
    appProject: 'node-katyusha-frontend-manage' // 项目名称
  };

  module.exports = {
    get qrLog() {
      return getLog(this, options);
    },
    ...logId
  }
  // use 
  this.ctx.qrLog.info({"res-rows": res});
1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago