0.1.0 • Published 2 months ago
@bunbot/pino-logger v0.1.0
@bunbot/pino-logger
@bunbot/azurekeyvault-loader adds pino logging support to BunBot. This implemention includes transports for console logging using pino-pretty, logging to a Discord webhook, and logging to Axiom.
Usage
- Add the package to your project:
bun add @bunbot/pino-logger
Update the plugins.secrets section of
BunBot.config.ts
as follows:logger: { name: '@bunbot/pino-logger', options: { prodLogLevel: 'info', devLogLevel: 'debug', }, },
Add the options for the transports you want to use. At least one transport must be enabled.
pino-pretty (formatted console logging)
usePinoPretty: true, pinoPrettyLogLevel: 'debug',
Discord webhook. Treat the webhook URL as a secret to avoid the channel getting spammed, make sure you configure your vault with the
loggerDiscordWebhookURL
key.useDiscordWebhook: true, discordLogLevel: 'warn', loggerDiscordWebhookURL: '*secret*',
Axiom. Axiom is a log agregator with a great free tier. Make sure to configure your secrets vault with the
axiomDataset
andaxiomAPIToken
keys.useAxiom: true, axiomLogLevel: `info`, axiomDataset: '*secret*', axiomAPIToken: '*secret*',
0.1.0
2 months ago