@youngkiu/pino-slack-webhook
v0.1.2
Published
pino-slack-webhook is a Pino v7+ compatible transport to forward log events to Slack from a dedicated worker
Downloads
2,102
Maintainers
Readme
@youngkiu/pino-slack-webhook
A Pino v7+ transport to send events to Slack
Installation
npm install --save @youngkiu/pino-slack-webhook
Usage
import pino from 'pino'
const logger = pino({
transport: {
target: '@youngkiu/pino-slack-webhook',
level: 'info',
options: {
webhookUrl: 'https://hooks.slack.com/services/xxx/xxx/xxx',
channel: '#pino-log',
username: 'webhookbot',
icon_emoji: ':ghost:'
}
}
})
logger.info('test log!');
Reference
- https://getpino.io/#/docs/transports?id=writing-a-transport
- https://github.com/autotelic/pino-seq-transport
- https://github.com/technicallyjosh/pino-http-send