- AgentConfig :
Object
- LogObject :
Object
Kind: global class
Extends: EventEmitter
- LogAgent ⇐
EventEmitter
Param | Type | Description |
---|---|---|
config | AgentConfig |
配置信息 |
callback | RunCallback |
回调函数 ,第一个参数为err,第二个参数为Array 其中每一个元素为一个LogObject |
启动日志监听
Kind: instance method of LogAgent
Param | Type | Description |
---|---|---|
[callback] | RunCallback |
回调函数 |
停止日志监听
Kind: instance method of LogAgent
读取日志出错事件
Kind: static property of LogAgent
发送日志出错事件
Kind: static property of LogAgent
发送日志成功事件
Kind: static property of LogAgent
Kind: global class
Param | Type | Description |
---|---|---|
config | AgentConfig |
配置信息 |
callback | RunCallback |
回调函数 ,第一个参数为err,第二个参数为Array 其中每一个元素为一个LogObject |
启动日志监听
Kind: instance method of LogAgent
Param | Type | Description |
---|---|---|
[callback] | RunCallback |
回调函数 |
停止日志监听
Kind: instance method of LogAgent
读取日志出错事件
Kind: static property of LogAgent
发送日志出错事件
Kind: static property of LogAgent
发送日志成功事件
Kind: static property of LogAgent
Kind: global function
Param | Type |
---|---|
err | Error |
param | Array.<LogObject> |
Kind: global typedef
Properties
Name | Type | Default | Description |
---|---|---|---|
logPath | Array.<String> |
监听日志文件地址,支持通配符匹配 | |
[queueScheduleProducer] | Object |
选填,kafka发送消息的对象 参见queue-schedule | |
[mutliLineRegexStart] | RegExp | String |
选填,多行匹配开始匹配符,输入正则表达式,匹配多行日志时作为日志起始点; | |
[mutliLineRegexContent] | RegExp | String |
'at ' |
选填,多行匹配内容匹配符 输入正则表达式,作为日志内容内容匹配标志符 如果开始匹配符校验通过, 但是内容匹配符校验不通过,则当前多行匹配结束,默认值:'at ' |
[mutliLineRegexEnd] | RegExp | String |
'' |
选填,多行匹配结尾匹配符,输入正则表达式,匹配多行日志时选填,作为日志结尾结束点 |
[filterRegex] | String |
选填,过滤匹配完成的日志内容,输入正则表达式 | |
[limit] | Number |
1024 |
选填, 一次性读取一个日志文件中日志(过滤完成后)数量,默认为1024 |
[nowRun] | Boolean |
false |
选填,是否在初始化时启动 |
[reportInterval] | Number |
1000 |
选填,轮询间隔 |
[alarm] | Object |
选填,发送日志对象 参见@yunnysunny/node-alarm | |
[alarmTitle] | String |
'Error occured' |
报警信息的标题 |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
log | String |
日志信息,换行符(\n)隔开 |
isMutliLine | Boolean |
true:多行匹配;false 单行匹配 |