logger

package
v0.0.0-...-b93bb50 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

View Source
const (
	FieldCorrelationID = "correlationID"
	FieldNamespace     = "namespace"
	FieldService       = "service"
	FieldAuthName      = "authName"
	FieldAuthID        = "authID"
	FieldAuthType      = "authType"
	FieldNewRelicTxn   = "newRelicTransaction"
)

Default key names for the metadata fields

Variables

This section is empty.

Functions

This section is empty.

Types

type CFFormatter

type CFFormatter struct {
	// TimestampFormat sets the format used for marshaling timestamps.
	TimestampFormat string
}

CFFormatter formats logs into parsable json

func (*CFFormatter) Format

func (f *CFFormatter) Format(entry *logrus.Entry) ([]byte, error)

Format renders a single log entry

type Hook

type Hook struct {
	AppName       string
	Prefix        string
	AppField      string
	FunctionField string
	SourceField   string
	Skip          int

	Formatter func(file, function string, line int) (string, string)
	// contains filtered or unexported fields
}

Hook define a Logrus hook

func NewHook

func NewHook(levels ...logrus.Level) *Hook

NewHook create new hook

func (*Hook) Fire

func (hook *Hook) Fire(entry *logrus.Entry) error

Fire Logrus hook function

func (*Hook) Levels

func (hook *Hook) Levels() []logrus.Level

Levels get hook levels

type NewRelicLogrusHook

type NewRelicLogrusHook struct {
	Application newrelic.Application
	LogLevels   []logrus.Level
}

NewRelicLogrusHook logrus hook for new relic

func NewNewRelicLogrusHook

func NewNewRelicLogrusHook(app newrelic.Application, levels []logrus.Level) *NewRelicLogrusHook

NewNewRelicLogrusHook create NewRelic Logrus hook

func (*NewRelicLogrusHook) Fire

func (n *NewRelicLogrusHook) Fire(entry *logrus.Entry) error

Fire fire logrus event hook

func (*NewRelicLogrusHook) Levels

func (n *NewRelicLogrusHook) Levels() []logrus.Level

Levels return levels for hook

Jump to

Keyboard shortcuts

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