1.0.51 • Published 7 months ago

zrplatform-lc-log v1.0.51

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

丽呈日志插件

  • AccessLog: 当前路由日志
  • ActionLog: 动作日志,通过client发起的网络请求日志
  • DataBaseLog: 数据库日志
  • BusinessLog: 业务日志
  • ThirdPartyLog: 第三方调用

使用方法

  1. 安装 npm install zrplatform-lc-log --save
  2. 在项目启动文件中作为zrplatform的log配置参数传入
const platform = require('zrplatform')
const httpTransport = require('zrplatform-http-transport')
const zrPlatformLcLog = require('zrplatform-lc-log')

platform
  .transport('http', httpTransport)
  .start()
  .logger(zrPlatformLcLog)

配置项说明

环境变量说明
ACCESSHOSTAccessLog 对应的kafka地址
ACCESSTOPICAccessLog 对应的Topic
ACTIONHOSTActionLog 对应的kafka地址
ACTIONTOPICActionLog 对应的Topic
BUSINESSHOSTBusinessLog 对应的kafka地址
BUSINESSTOPICBusinessLog 对应的Topic
DATABASEHOSTDataBaseLog 对应的kafka地址
DATABASETOPICDataBaseLog 对应的Topic
THIRDPARTYHOSTThirdpartyLog 对应的kafka地址
THIRDPARTYTOPICThirdpartyLog 对应的Topic

AccessLog

该日志参数由zrplatform框架拦截express的req和res创建

ActionLog

该日志参数由zrplatform框架拦截express和request的req和res创建

DataBaseLog

参数名说明默认值
position位置
scene场景
logContent备注信息
user用户
error.message错误信息
error.stack堆栈

BusinessLog

参数名说明默认值
position位置
scene场景
logContent备注信息
user用户
error.message错误信息
error.stack堆栈

ThirdPartyLog

参数名说明默认值
logType是否异常,异常=1,正常=0
methodName方法名称
exceptionMessage异常信息
detail详细异常信息
parameters方法的入参 json格式
result方法的返回值 json格式
urlAliasesurl别名
realUrl真实请求的url
timeout超时时间
retryCount重试次数