Help us shape the future of Go! Take the 2026 Go Developer Survey

httplog

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(logger *zap.Logger, message string, r *http.Request, status int, cause error, fields ...zap.Field)

Error writes a structured HTTP error log entry.

func ResponseError

func ResponseError(logger *zap.Logger, message string, r *http.Request, w RecordedResponse, fields ...zap.Field)

ResponseError logs a completed error response captured by a response recorder.

func WriteError

func WriteError(logger *zap.Logger, w http.ResponseWriter, r *http.Request, status int, clientMessage string, cause error, fields ...zap.Field) error

WriteError logs an HTTP error and writes the standard JSON error response.

Types

type RecordedResponse

type RecordedResponse interface {
	StatusCode() int
	BodyBytes() []byte
}

RecordedResponse exposes response data captured by middleware or wrappers.

Jump to

Keyboard shortcuts

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