rusrelic

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

README

rusrelic

Logrus hook for the New Relic Log API.

Installation

go get github.com/abrunner94/rusrelic

Usage

// Specify the EU region with "EU" if necessary and your New Relic License Key
rusrelicClient, _ := rusrelic.NewClient("US", "NEW_RELIC_LICENSE_KEY")
rusrelicHook := rusrelic.NewHook(rusrelicClient, rusrelic.DefaultLevels)

// Add the hook to logrus
log.AddHook(rusrelicHook)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EndpointGeneric = "https://log-api.newrelic.com/log/v1"
	EndpointEU      = "https://log-api.eu.newrelic.com/log/v1"
)

Functions

This section is empty.

Types

type Client

type Client struct {
	Region     string
	LicenseKey string
}

func NewClient

func NewClient(region string, licenseKey string) (*Client, error)

func (*Client) Log

func (c *Client) Log(entry *logrus.Entry) (*event, error)

type Hook

type Hook struct {
	Client *Client
	// contains filtered or unexported fields
}

func NewHook

func NewHook(client *Client, levels []logrus.Level) *Hook

func (*Hook) Fire

func (h *Hook) Fire(entry *logrus.Entry) error

func (*Hook) Levels

func (h *Hook) Levels() []logrus.Level

Jump to

Keyboard shortcuts

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