logcontext

package
v3.32.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 1 Imported by: 9

README

v3/integrations/logcontext GoDoc

Logs in Context. Each directory represents a different logging plugin. Plugins allow you to add the context required to your log messages so you can see linking in the APM UI.

For more information, see godocs.

Documentation

Overview

Package logcontext facilitates adding New Relic context to your logs.

Adding New Relic context to your logs will allow you to see links between your events and traces in APM and your logs. If you are using a logging framework that does not already have a New Relic plugin for log decoration, use this package to manually add logging context.

See https://github.com/newrelic/newrelic-exporter-specs/tree/master/logging for a complete specification.

Index

Constants

View Source
const (
	KeyFile       = "file.name"
	KeyLevel      = "log.level"
	KeyLine       = "line.number"
	KeyMessage    = "message"
	KeyMethod     = "method.name"
	KeyTimestamp  = "timestamp"
	KeyTraceID    = "trace.id"
	KeySpanID     = "span.id"
	KeyEntityName = "entity.name"
	KeyEntityType = "entity.type"
	KeyEntityGUID = "entity.guid"
	KeyHostname   = "hostname"
)

Keys used for logging context JSON.

Variables

This section is empty.

Functions

func AddLinkingMetadata

func AddLinkingMetadata(m map[string]interface{}, md newrelic.LinkingMetadata)

AddLinkingMetadata adds the LinkingMetadata into a map. Only non-empty string fields are included in the map. The specific key names facilitate agent logs in context. These keys are: "trace.id", "span.id", "entity.name", "entity.type", "entity.guid", and "hostname".

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