logcontext

package
v3.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LogSeverityFieldName is the name of the log level field in New Relic logging JSON
	LogSeverityFieldName = "level"

	// LogMessageFieldName is the name of the log message field in New Relic logging JSON
	LogMessageFieldName = "message"

	// LogTimestampFieldName is the name of the timestamp field in New Relic logging JSON
	LogTimestampFieldName = "timestamp"

	// LogSpanIDFieldName is the name of the span ID field in the New Relic logging JSON
	LogSpanIDFieldName = "span.id"

	// LogTraceIDFieldName is the name of the trace ID field in the New Relic logging JSON
	LogTraceIDFieldName = "trace.id"

	// LogSeverityUnknown is the value the log severity should be set to if no log severity is known
	LogSeverityUnknown = "UNKNOWN"

	// number of bytes expected to be needed for the average log message
	AverageLogSizeEstimate = 400
)

Exported Constants for log decorators

Variables

This section is empty.

Functions

func ValidateDecoratedOutput

func ValidateDecoratedOutput(t *testing.T, out *bytes.Buffer, expect *DecorationExpect)

ValidateDecoratedOutput is a testing tool that validates whether a bytes buffer decorated by a logcontext v2 decorator contains the values we expect it to.

Types

type DecorationExpect

type DecorationExpect struct {
	DecorationDisabled bool
	EntityGUID         string
	EntityName         string
	Hostname           string
	TraceID            string
	SpanID             string
}

DecorationExpect defines the expected values a log decorated by a logcontext v2 decorator should have

Jump to

Keyboard shortcuts

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