github.com/newrelic/go-agent@v3.26.0+incompatible/_integrations/nrzap/example_test.go (about) 1 // Copyright 2020 New Relic Corporation. All rights reserved. 2 // SPDX-License-Identifier: Apache-2.0 3 4 package nrzap 5 6 import ( 7 newrelic "github.com/newrelic/go-agent" 8 "go.uber.org/zap" 9 ) 10 11 func Example() { 12 cfg := newrelic.NewConfig("Example App", "__YOUR_NEWRELIC_LICENSE_KEY__") 13 14 // Create a new zap logger: 15 z, _ := zap.NewProduction() 16 17 // Use nrzap to register the logger with the agent: 18 cfg.Logger = Transform(z.Named("newrelic")) 19 20 newrelic.NewApplication(cfg) 21 }