package httplog
import "k8s.io/apiserver/pkg/server/httplog"
Package httplog contains a helper object and functions to maintain a log along with an http response.
Index ¶
- func DefaultStacktracePred(status int) bool
- func LogOf(req *http.Request, w http.ResponseWriter) logger
- func Unlogged(req *http.Request, w http.ResponseWriter) http.ResponseWriter
- func WithLogging(handler http.Handler, pred StacktracePred) http.Handler
- type StacktracePred
Functions ¶
func DefaultStacktracePred ¶
DefaultStacktracePred is the default implementation of StacktracePred.
func LogOf ¶
func LogOf(req *http.Request, w http.ResponseWriter) logger
LogOf returns the logger hiding in w. If there is not an existing logger then a passthroughLogger will be created which will log to stdout immediately when Addf is called.
func Unlogged ¶
func Unlogged(req *http.Request, w http.ResponseWriter) http.ResponseWriter
Unlogged returns the original ResponseWriter, or w if it is not our inserted logger.
func WithLogging ¶
func WithLogging(handler http.Handler, pred StacktracePred) http.Handler
WithLogging wraps the handler with logging.
Types ¶
type StacktracePred ¶
StacktracePred returns true if a stacktrace should be logged for this status.
func StatusIsNot ¶
func StatusIsNot(statuses ...int) StacktracePred
StatusIsNot returns a StacktracePred which will cause stacktraces to be logged for any status *not* in the given list.
Source Files ¶
doc.go httplog.go
- Version
- v0.21.5
- Published
- Sep 17, 2021
- Platform
- windows/amd64
- Imports
- 8 packages
- Last checked
- 1 second ago –
Tools for package owners.