logger

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultLoggingMiddleware = emiddleware.LoggerWithConfig(
	emiddleware.LoggerConfig{
		Format: `[${time_rfc3339}] ${status} ${method} ${uri} | request_id=${header:` +
			echo.HeaderXRequestID + `} user_agent="${user_agent}" remote_ip=${remote_ip} ` +
			`bytes_in=${bytes_in} bytes_out=${bytes_out} latency=${latency_human}` + "\n",
		Skipper: func(c echo.Context) bool {
			return c.Path() == "/info" || c.Path() == "/metrics"
		},
	},
)

DefaultLoggingMiddleware exposes the default logging middleware for the platform

Functions

func Middleware

func Middleware() echo.MiddlewareFunc

Middleware exposes a logging MiddlewareFunc for echo

func New

func New(conf configurer.Config, bc configurer.BuildConfig) echo.Logger

New : Creates a default echo logger object, properly configured

Types

type Logger

type Logger struct {
	*logrus.Logger
}

Logger is the logrus Logger assigned globally for this package

func (Logger) Debugj

func (l Logger) Debugj(j log.JSON)

Debugj is a function for logging a JSON object to logrus, with Fields

func (Logger) Errorj

func (l Logger) Errorj(j log.JSON)

Errorj is a function for logging a JSON object to logrus, with Fields

func (Logger) Fatalj

func (l Logger) Fatalj(j log.JSON)

Fatalj is a function for logging a JSON object to logrus, with Fields

func (Logger) Infoj

func (l Logger) Infoj(j log.JSON)

Infoj is a function for logging a JSON object to logrus, with Fields

func (Logger) Level

func (l Logger) Level() log.Lvl

Level is an echo logger wrapper for getting the log Level

func (Logger) Output

func (l Logger) Output() io.Writer

Output is an echo logger wrapper for getting the raw Output

func (Logger) Panicj

func (l Logger) Panicj(j log.JSON)

Panicj is a function for logging a JSON object to logrus, with Fields, then Panicking

func (Logger) Prefix

func (l Logger) Prefix() string

Prefix is an echo logger wrapper for getting a prefix. Not supported by logrus.

func (Logger) Printj

func (l Logger) Printj(j log.JSON)

Printj is a function for logging a JSON object to logrus, with Fields

func (Logger) SetHeader

func (l Logger) SetHeader(s string)

SetHeader is an echo logger wrapper for setting a prefix. Not supported by logrus.

func (Logger) SetLevel

func (l Logger) SetLevel(lvl log.Lvl)

SetLevel is an echo logger wrapper for setting the Log Level

func (Logger) SetOutput

func (l Logger) SetOutput(w io.Writer)

SetOutput is an echo logger wrapper for setting the Output

func (Logger) SetPrefix

func (l Logger) SetPrefix(s string)

SetPrefix is an echo logger wrapper for setting a prefix. Not supported by logrus.

func (Logger) Warnj

func (l Logger) Warnj(j log.JSON)

Warnj is a function for logging a JSON object to logrus, with Fields

Jump to

Keyboard shortcuts

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