@bachman-dev/pino-discord-transport
v0.3.0
Published
A pino transport that sends a log entry to a Discord webhook
Downloads
21
Readme
@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,
},
},
],
},
});