logger

package
v0.0.0-...-fe06dec Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Log is an instance of the global logrus.Logger

Functions

func AccessLoggerMiddleware

func AccessLoggerMiddleware(next http.Handler) http.Handler

func FlushLogger

func FlushLogger()

func InitLogger

func InitLogger()

InitLogger initializes the logger instance

func LogError

func LogError(msg string, err error)

func LogErrorWithAccountAndClientId

func LogErrorWithAccountAndClientId(msg string, err error, account domain.AccountID, org_id domain.OrgID, client_id domain.ClientID)

func LogFatalError

func LogFatalError(msg string, err error)

func LogWithError

func LogWithError(log *logrus.Entry, msg string, err error)

Types

type CustomCloudwatch

type CustomCloudwatch struct {
	Hostname string
}

CustomCloudwatch adds hostname and app name

func NewCloudwatchFormatter

func NewCloudwatchFormatter() *CustomCloudwatch

NewCloudwatchFormatter creates a new log formatter

func (*CustomCloudwatch) Format

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

Format is the log formatter for the entry

type Marshaler

type Marshaler interface {
	MarshalLog() map[string]interface{}
}

Marshaler is an interface any type can implement to change its output in our production logs.

Jump to

Keyboard shortcuts

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