go-agent: github.com/newrelic/go-agent/v3/integrations/nrlogxi Index | Examples | Files

package nrlogxi

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

Package nrlogxi supports https://github.com/mgutz/logxi.

Wrap your logxi Logger using nrlogxi.New to send agent log messages through logxi.

Code:

// Create a new logxi logger:
l := log.New("newrelic")
l.SetLevel(log.LevelInfo)

newrelic.NewApplication(
    newrelic.ConfigAppName("Example App"),
    newrelic.ConfigLicense("__YOUR_NEWRELIC_LICENSE_KEY__"),
    // Use nrlogxi to register the logger with the agent:
    nrlogxi.ConfigLogger(l),
)

Index

Examples

Package Files

nrlogxi.go

func ConfigLogger Uses

func ConfigLogger(l log.Logger) newrelic.ConfigOption

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

func New Uses

func New(l log.Logger) newrelic.Logger

New returns a newrelic.Logger which forwards agent log messages to the provided logxi Logger.

Package nrlogxi imports 3 packages (graph). Updated 2020-07-02. Refresh now. Tools for package owners.