0.1.0 • Published 2 months ago

@bunbot/pino-logger v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

@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

  1. Add the package to your project: bun add @bunbot/pino-logger
  2. Update the plugins.secrets section of BunBot.config.ts as follows:

    logger: {
        name: '@bunbot/pino-logger',
        options: {
            prodLogLevel: 'info',
            devLogLevel: 'debug',
        },
    },
  3. 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 and axiomAPIToken keys.

      useAxiom: true,
      axiomLogLevel: `info`,
      axiomDataset: '*secret*',
      axiomAPIToken: '*secret*',