log

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(ctx context.Context, msgFormat string, args ...interface{})

func Debuge

func Debuge(e pubsub.Event, msgFormat string, args ...interface{})

func Debugf

func Debugf(msgFormat string, args ...interface{})

func Debugw

func Debugw(keysAndValues []interface{}, msgFormat string, args ...interface{})

func Error

func Error(ctx context.Context, msgFormat string, args ...interface{})

func Errore

func Errore(e pubsub.Event, msgFormat string, args ...interface{})

func Errorf

func Errorf(msgFormat string, args ...interface{})

func Errorw

func Errorw(keysAndValues []interface{}, msgFormat string, args ...interface{})

func Fatal

func Fatal(ctx context.Context, msgFormat string, args ...interface{})

func Fatale

func Fatale(e pubsub.Event, msgFormat string, args ...interface{})

func Fatalf

func Fatalf(msgFormat string, args ...interface{})

func Fatalw

func Fatalw(keysAndValues []interface{}, msgFormat string, args ...interface{})

func Info

func Info(ctx context.Context, msgFormat string, args ...interface{})

func Infoe

func Infoe(e pubsub.Event, msgFormat string, args ...interface{})

func Infof

func Infof(msgFormat string, args ...interface{})

func Infow

func Infow(keysAndValues []interface{}, msgFormat string, args ...interface{})

func ReplaceGlobal

func ReplaceGlobal(logger log.Logger)

ReplaceGlobal Register a logger instance as global

func Warn

func Warn(ctx context.Context, msgFormat string, args ...interface{})

func Warne

func Warne(e pubsub.Event, msgFormat string, args ...interface{})

func Warnf

func Warnf(msgFormat string, args ...interface{})

func Warnw

func Warnw(keysAndValues []interface{}, msgFormat string, args ...interface{})

Types

type HttpRequestLog

type HttpRequestLog struct {
	LoggingContext
	Url            string `json:"url"`
	Status         int    `json:"status"`
	ExecutionTime  int64  `json:"execution_time"`
	RequestPattern string `json:"request_pattern,omitempty"`
	RequestPath    string `json:"request_path"`
	Method         string `json:"request_method"`
	Query          string `json:"query,omitempty"`
	RequestId      string `json:"request_id,omitempty"`
	CallerId       string `json:"caller_id,omitempty"`
	ClientIp       string `json:"client_ip,omitempty"`
	UserAgent      string `json:"user_agent,omitempty"`
}

type LoggingContext

type LoggingContext struct {
	CorrelationId     string `json:"request_id,omitempty"`
	UserId            string `json:"jwt_subject,omitempty"`
	DeviceId          string `json:"device_id,omitempty"`
	DeviceSessionId   string `json:"device_session_id,omitempty"`
	TechnicalUsername string `json:"technical_username,omitempty"`
}

func BuildLoggingContextFromEvent

func BuildLoggingContextFromEvent(e *event.AbstractEvent) *LoggingContext

func BuildLoggingContextFromEventAttr

func BuildLoggingContextFromEventAttr(attributes *event.Attributes) *LoggingContext

func BuildLoggingContextFromReqAttr

func BuildLoggingContextFromReqAttr(requestAttributes *webContext.RequestAttributes) *LoggingContext

Jump to

Keyboard shortcuts

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