httplog

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	http.Handler
	// contains filtered or unexported fields
}

Logger middleware wrapping Handler.

func New

func New(h http.Handler, opts ...LoggerOption) *Logger

New middleware wrapping `h`.

func (*Logger) ServeHTTP

func (l *Logger) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implementation.

type LoggerOption

type LoggerOption func(*Logger)

LoggerOption configures a Logger.

func ExcludePathPrefix

func ExcludePathPrefix(pathPrefix string) LoggerOption

ExcludePathPrefix configures the logger to not log requests with the given path prefix

Jump to

Keyboard shortcuts

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