logger

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package logger provides a logger middleware to log the http request.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Collect is used to collect the extra key-value attributes if set.
	//
	// Default: nil
	Collect func(w http.ResponseWriter, r *http.Request, append func(...slog.Attr))

	// Enabled is used to decide whether to log the request if set.
	//
	// Default: nil
	Enabled func(*http.Request) bool
)

Functions

func Logger

func Logger(next http.Handler) http.Handler

Logger is a http middleware to log the http request.

Types

This section is empty.

Jump to

Keyboard shortcuts

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