logrus

package
v2.3.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2019 License: OSL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextHook

type ContextHook struct {
	// contains filtered or unexported fields
}

func (ContextHook) Fire

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

func (ContextHook) Levels

func (hook ContextHook) Levels() []logrus.Level

Levels returns all available logrus log levels

type LogrusEntry

type LogrusEntry struct {
	*logrus.Entry
}

LogrusEntry is a Wrapper for the logrus.Entry logger fulfilling the flamingo.Logger interface

func (*LogrusEntry) Flush

func (e *LogrusEntry) Flush()

Flush does nothing because logrus is not buffered

func (*LogrusEntry) WithContext

func (e *LogrusEntry) WithContext(ctx context.Context) flamingo.Logger

WithContext returns a logger with fields filled from the context businessId: From Header X-Business-ID client_ip: From Header X-Forwarded-For or request if header is empty correlationId: The ID of the context method: HTTP verb from request path: URL path from request referer: referer from request request: received payload from request

func (*LogrusEntry) WithField

func (e *LogrusEntry) WithField(key flamingo.LogKey, value interface{}) flamingo.Logger

WithField adds a single field to the Entry.

func (*LogrusEntry) WithFields

func (e *LogrusEntry) WithFields(fields map[flamingo.LogKey]interface{}) flamingo.Logger

WithFields adds a map of fields to the Entry.

type LogrusLogger

type LogrusLogger struct {
	*logrus.Logger
}

LogrusLogger is a Wrapper for the logrus.Logger fulfilling the flamingo.Logger interface

func (*LogrusLogger) Flush

func (e *LogrusLogger) Flush()

Flush does nothing because logrus is not buffered

func (*LogrusLogger) WithContext

func (e *LogrusLogger) WithContext(ctx context.Context) flamingo.Logger

WithContext returns a logger with fields filled from the context businessId: From Header X-Business-ID client_ip: From Header X-Forwarded-For or request if header is empty correlationId: The ID of the context method: HTTP verb from request path: URL path from request referer: referer from request request: received payload from request

func (*LogrusLogger) WithField

func (e *LogrusLogger) WithField(key flamingo.LogKey, value interface{}) flamingo.Logger

WithField adds a field to the log entry, note that it doesn't log until you call Debug, Print, Info, Warn, Fatal or Panic. It only creates a log entry. If you want multiple fields, use `WithFields`.

func (*LogrusLogger) WithFields

func (e *LogrusLogger) WithFields(fields map[flamingo.LogKey]interface{}) flamingo.Logger

WithFields adds a struct of fields to the log entry. All it does is call `WithField` for each `Field`.

type Module

type Module struct {
	Area        string `inject:"config:area"`
	JSON        bool   `inject:"config:logrus.json,optional"`
	LogLevel    string `inject:"config:logrus.loglevel,optional"`
	ForceColors bool   `inject:"config:logrus.forceColors,optional"`
}

Module for logrus logging deprecated: old and unstable, upgrade to zap please

func (*Module) Configure

func (m *Module) Configure(injector *dingo.Injector)

Configure the logrus logger as flamingo.Logger (in JSON mode kibana compatible)

Jump to

Keyboard shortcuts

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