From e939e45effec039b29a04df1633d219ca0525b99 Mon Sep 17 00:00:00 2001 From: YoungKi Lyu Date: Thu, 8 Jun 2023 23:42:12 +0900 Subject: [PATCH] docs: add pino-slack-webhook to list of v7+ compatible transports --- docs/transports.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/transports.md b/docs/transports.md index 8a2239ba6..8e4882077 100644 --- a/docs/transports.md +++ b/docs/transports.md @@ -398,6 +398,7 @@ PRs to this document are welcome for any new transports! + [pino-sentry-transport](#pino-sentry-transport) + [pino-airbrake-transport](#pino-airbrake-transport) + [pino-datadog-transport](#pino-datadog-transport) ++ [pino-slack-webhook](#pino-slack-webhook) ### Legacy @@ -908,6 +909,29 @@ $ node app.js | pino-websocket -a my-websocket-server.example.com -p 3004 For full documentation of command line switches read the [README](https://github.com/abeai/pino-websocket#readme). + +### pino-slack-webhook + +[pino-slack-webhook][pino-slack-webhook] is a Pino v7+ compatible transport to forward log events to [Slack][Slack] +from a dedicated worker: + +```js +const pino = require('pino') +const transport = pino.transport({ + target: '@youngkiu/pino-slack-webhook', + options: { + webhookUrl: 'https://hooks.slack.com/services/xxx/xxx/xxx', + channel: '#pino-log', + username: 'webhookbot', + icon_emoji: ':ghost:' + } +}) +pino(transport) +``` + +[pino-slack-webhook]: https://github.com/youngkiu/pino-slack-webhook +[Slack]: https://slack.com/ + [pino-pretty]: https://github.com/pinojs/pino-pretty