0.2.0 • Published 3 years ago
lyf-vue-error-log v0.2.0
lyf-vue-error-log
vue项目线上错误日志采集
导入插件
npm install lyf-vue-error-log
项目中使用
在项目根目录中的main.js
中,引入并使用
import errorLog from 'lyf-vue-error-log'
Vue.use(errorLog, {interfaceUrl: '将日志传给后端的接口地址'})
配置项
属性名 | 说明 | 类型 | 默认值 | 可选值 |
---|---|---|---|---|
interfaceUrl | 后端接收报错信息接口地址 | String | - | - |
env | 执行日志采集的环境 | String/Array | 'production' | production/development |
传给后端接口的字段说明
字段名 | 说明 | 类型 | 详情 |
---|---|---|---|
clientType | 客户端类型 | String | pc:电脑端;mobile:移动端 |
clientOS | 客户端操作系统 | String | 移动端可获取,pc返回null |
clientModel | 客户端机型 | String | 移动端可获取用户手机机型,pc端返回空串 |
errInfo | 捕获的错误堆栈信息 | String | - |
vueErrInfo | Vue 特定的错误信息,比如错误所在的生命周期钩子 | String | - |