nrlogrus

package
v3.19.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package nrlogrus sends go-agent log messages to https://github.com/sirupsen/logrus.

Use this package if you are using logrus in your application and would like the go-agent log messages to end up in the same place. If you are using the logrus standard logger, assign the newrelic.Config.Logger field to nrlogrus.StandardLogger():

cfg := newrelic.NewConfig("Your Application Name", "__YOUR_NEW_RELIC_LICENSE_KEY__")
cfg.Logger = nrlogrus.StandardLogger()

If you are using a particular logrus Logger instance, assign the newrelic.Config.Logger field to the the output of nrlogrus.Transform:

l := logrus.New()
l.SetLevel(logrus.DebugLevel)
cfg := newrelic.NewConfig("Your Application Name", "__YOUR_NEW_RELIC_LICENSE_KEY__")
cfg.Logger = nrlogrus.Transform(l)

This package requires logrus version v1.1.0 and above.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StandardLogger

func StandardLogger() newrelic.Logger

StandardLogger returns a newrelic.Logger which forwards agent log messages to the logrus package-level exported logger.

func Transform

func Transform(l *logrus.Logger) newrelic.Logger

Transform turns a *logrus.Logger into a newrelic.Logger.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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