nrlogrus

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: Apache-2.0 Imports: 3 Imported by: 20

README

v3/integrations/nrlogrus GoDoc

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

import "github.com/newrelic/go-agent/v3/integrations/nrlogrus"

For more information, see godocs.

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, use ConfigStandardLogger when creating your application:

app, err := newrelic.NewApplication(
	newrelic.ConfigFromEnvironment(),
	nrlogrus.ConfigStandardLogger(),
)

If you are using a particular logrus Logger instance, then use ConfigLogger:

l := logrus.New()
l.SetLevel(logrus.DebugLevel)
app, err := newrelic.NewApplication(
	newrelic.ConfigFromEnvironment(),
	nrlogrus.ConfigLogger(l),
)

This package requires logrus version v1.1.0 and above.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigLogger

func ConfigLogger(l *logrus.Logger) newrelic.ConfigOption

ConfigLogger configures the newrelic.Application to send log messsages to the provided logrus logger.

func ConfigStandardLogger

func ConfigStandardLogger() newrelic.ConfigOption

ConfigStandardLogger configures the newrelic.Application to send log messsages to the standard logrus logger.

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