logging

package
v0.0.0-...-948bed2 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestLogger

func RequestLogger(l logr.Logger) func(next http.Handler) http.Handler

RequestLogger sets up a post-request handler to log out the request.

func WithRequestValues

func WithRequestValues(l logr.Logger, r *http.Request) logr.Logger

WithRequestValues adds various items from the request to the values associated with the logger for use in logging HTTP requests.

Types

type ResponseWriterWrapper

type ResponseWriterWrapper interface {
	http.ResponseWriter
	// Status returns the HTTP status of the request, or 0 if one has not
	// yet been sent.
	Status() int
	// BytesWritten returns the total number of bytes sent to the client.
	BytesWritten() int
	// Unwrap returns the original proxied target.
	Unwrap() http.ResponseWriter
}

ResponseWriterWrapper is a proxy around an http.ResponseWriter that allows you to hook into various parts of the response process.

func WrapWriter

WrapWriter wraps an http.ResponseWriter in a proxy that implements the ResponseWriterWrapper interface.

Jump to

Keyboard shortcuts

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