go-agent: github.com/newrelic/go-agent/_integrations/nrzap Index | Examples | Files

package nrzap

import "github.com/newrelic/go-agent/_integrations/nrzap"

Package nrzap supports https://github.com/uber-go/zap

Wrap your zap Logger using nrzap.Transform to send agent log messages to zap.

Code:

cfg := newrelic.NewConfig("Example App", "__YOUR_NEWRELIC_LICENSE_KEY__")

// Create a new zap logger:
z, _ := zap.NewProduction()

// Use nrzap to register the logger with the agent:
cfg.Logger = Transform(z.Named("newrelic"))

newrelic.NewApplication(cfg)

Index

Examples

Package Files

nrzap.go

func Transform Uses

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

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

Package nrzap imports 3 packages (graph). Updated 2019-10-24. Refresh now. Tools for package owners.