@ruangnazi/log4js-dingbot
v1.0.1
Published
log4js dingding appender
Downloads
7
Maintainers
Readme
dingtalk(钉钉) log4js appender
send log to ding bot.
ratelimit is 20/min
Install
npm
npm install log4js @ruangnazi/log4js-dingbot
yarn
yarn add log4js @ruangnazi/log4js-dingbot
Configuration
type
-@ruangnazi/log4js-dingbot
access_token
-string
- your access_tokensecret
-string
(optional, defaults tonull
) - your secret, see robot Webhook apisendInterval
-integer
(optional, defaults to3
) - batch ding and send in ding every sendInterval seconds, if 0 then every log message will send an ding. see api ratelimitsplitSendInterval
-integer
(optional, defaults to3
) - log message long than 19000 bytes will spilt to send every splitSendInterval seconds.shutdownTimeout
-integer
(optional, defaults to5
) - time in seconds to wait for emails to be sent during shutdownlayout
-object
(optional, defaults to basicLayout) - see layouts
Example
log4js.configure({
appenders: {
out: { type: 'stdout' },
dingbot: {
type: '@ruangnazi/log4js-dingbot',
access_token: 'access_token',
secret: 'secret',
sendInterval: 5
}
},
categories: { default: { appenders: ['out', 'dingbot'], level: 'debug' } }
})
const app = log4js.getLogger()
app.info('测试钉钉')