log

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: MPL-2.0 Imports: 3 Imported by: 2

README

Log

Middleware for logging request and response data.

Usage

Import

import "github.com/ngamux/middleware/log"

Instance With Default Config

logMiddleware := log.New()

Instance With Custom Config

logMiddleware := log.New(log.Config{
  Format: "${method} ${path} ${status}",
})

Mount to Ngamux

mux := ngamux.New()
mux.Use(logMiddleware)

Documentation

Index

Constants

View Source
const (
	TagMethod string = "method"
	TagPath   string = "path"
	TagStatus string = "status"
)

Variables

This section is empty.

Functions

func New

func New(config ...Config) func(next http.HandlerFunc) http.HandlerFunc

Types

type Config

type Config struct {
	Handler slog.Handler
}

Jump to

Keyboard shortcuts

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