rollbarplugin

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 5 Imported by: 3

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()
log := logger.Default()
ctx := logger.ToCtx(context.Background(), log)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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