0.1.0 • Published 2 years 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.tsas 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
loggerDiscordWebhookURLkey.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
axiomDatasetandaxiomAPITokenkeys.useAxiom: true, axiomLogLevel: `info`, axiomDataset: '*secret*', axiomAPIToken: '*secret*',
0.1.0
2 years ago