Documentation ¶
Index ¶
Constants ¶
View Source
const RESPONSE_BODY_LOG_LIMIT = 1000
Maximum number of bytes of response body which will be logged.
Variables ¶
This section is empty.
Functions ¶
func LogMiddleware ¶
Add an logging middleware to an http.Handler. For each HTTP request the middleware will call infoLogger if the status code indicates a successful HTTP request (1xx, 2xx, or 3xx). errorLogger will be called otherwise. The argument passed to infoLogger and errorLogger are intended to be logged by plog.LogAsJson or by logging the result of json.Marshal.
Types ¶
Click to show internal directories.
Click to hide internal directories.