logutil

package
v0.0.0-...-91592c9 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: MIT Imports: 5 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPLogger

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

HTTPLogger wraps the Go-Kit Logger to return a logger which implements a ServerFinalizerFunc. The ServerFinalizerFunc can be passed to finalizer.Middleware or a Go-Kit Server to create a structured HTTP Logger.

func NewHTTPLogger

func NewHTTPLogger(logger log.Logger) *HTTPLogger

NewHTTPLogger returns a Logger from a Go-Kit Logger.

func (*HTTPLogger) LoggingFinalizer

func (l *HTTPLogger) LoggingFinalizer(ctx context.Context, code int, r *http.Request)

LoggingFinalizer is a finalizer.ServerFinalizerFunc which logs information about a completed HTTP Request.

func (*HTTPLogger) Middleware

func (l *HTTPLogger) Middleware(next http.Handler) http.Handler

Middleware returns creates an HTTP logging middleware using LoggingFinalizer.

Jump to

Keyboard shortcuts

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