httplog

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	http.Handler

	Logger *slog.Logger
	Attrs  func(*http.Request) []slog.Attr
}

Handler wraps an HTTP handler and logs each request after it completes.

It records the response status, transmitted byte count, duration, and hijack state. Successful 2xx responses are logged at debug level; all other responses are logged at info level.

func (Handler) ServeHTTP

func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler.

Jump to

Keyboard shortcuts

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