nrlogxi

package
v3.13.0+incompatible Latest Latest
Warning

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

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

README

_integrations/nrlogxi/v1 GoDoc

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

import "github.com/newrelic/go-agent/_integrations/nrlogxi/v1"

For more information, see godocs.

Documentation

Overview

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

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

Example
package main

import (
	log "github.com/mgutz/logxi/v1"
	newrelic "github.com/newrelic/go-agent"

	nrlogxi "github.com/newrelic/go-agent/_integrations/nrlogxi/v1"
)

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

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

	// Use nrlogxi to register the logger with the agent:
	cfg.Logger = nrlogxi.New(l)

	newrelic.NewApplication(cfg)
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(l log.Logger) newrelic.Logger

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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