rollbarplugin

package
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2025 License: MIT Imports: 5 Imported by: 4

README

Rollbar Plugin

This plugin will send every log with a level >= Error to rollbar.

Configuration

This plugin needs two different environment variables:

  • ROLLBAR_TOKEN: The rollbar token used to authenticate against the Rollbar API
  • GO_ENV: The go environment

Usage

To use this plugin, register it during the initialization of your program.

/!\ This line MUST be written BEFORE the first initialization of the logger.

rollbarplugin.Register()
defer rollbarplugin.Close()

log := logger.Default()
ctx := logger.ToCtx(context.Background(), log)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close added in v1.5.0

func Close()

Close blocks untils the queue is empty and then closes the rollbar client.

func Register

func Register()

Register the plugin to the logger library

Types

type RollbarPlugin

type RollbarPlugin struct{}

func (RollbarPlugin) Hook

func (p RollbarPlugin) Hook() (bool, logrus.Hook)

Generate the hook

func (RollbarPlugin) Name

func (p RollbarPlugin) Name() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL