logginghttp

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package logginghttp provides net/http access log middleware built on top of the logging package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAccessLogMiddleware

func NewAccessLogMiddleware(baseLogger *logging.Logger, config AccessLogConfig) func(http.Handler) http.Handler

NewAccessLogMiddleware returns a net/http access log middleware.

Types

type AccessLogConfig

type AccessLogConfig struct {
	RequestIDHeader string

	SkipPaths       []string
	SkipPathRegexps []*regexp.Regexp
	Skipper         func(*http.Request) bool

	DefaultLevel     logging.Level
	ClientErrorLevel logging.Level
	ServerErrorLevel logging.Level
	PathLevels       map[string]logging.Level

	RecoverPanic  bool
	LogPanicStack bool

	TrustProxyHeaders bool

	MaxRequestFieldCount   int
	MaxRequestMessageCount int
	MaxRequestErrorCount   int
}

AccessLogConfig controls HTTP access logging.

Jump to

Keyboard shortcuts

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