@bachman-dev/pino-discord-transport
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

@bachman-dev/pino-discord-transport

Use this transport with pino to send logs to a Discord webhook

Usage

pnpm install @bachman-dev/pino-discord-transport

In your project:

pino({
  transport: {
    targets: [
      {
        target: "pino/file",
        options: {
          // Write to STDOUT
          destination: 1,
        },
      },
      {
        level: "warn",
        target: "@bachman-dev/pino-discord-transport",
        options: {
          webhookUrl: process.env.DISCORD_WEBHOOK_URL,
          // optionally mention a user in the message
          messageId: process.env.DISCORD_WEBHOOK_MENTION_ID,
        },
      },
    ],
  },
});

Readme

Keywords

none

Package Sidebar

Install

npm i @bachman-dev/pino-discord-transport

Weekly Downloads

0

Version

0.3.0

License

MIT

Unpacked Size

6.72 kB

Total Files

5

Last publish

Collaborators

  • bachmacintosh