httplog

package
v0.0.0-...-86e7852 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package httplog logs one line per HTTP request through the application's slog.Logger.

It replaces github.com/samber/slog-echo, which is unusable on Echo v5: it tests for a routing error with err.(*echo.HTTPError), and v5 returns the unexported *echo.httpError, so every 404 was reported and logged as a 500. Echo's own RequestLogger resolves the status through the error handler instead, which is the only thing that knows it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(
	logger *slog.Logger,
) echo.MiddlewareFunc

New returns middleware logging each request to logger. Field names follow what slog-echo emitted, so anything reading these logs keeps working.

Types

This section is empty.

Jump to

Keyboard shortcuts

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