Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Middleware ¶
func CombinedLogger ¶
func CombinedLogger(out io.Writer) Middleware
CombinedLogger and CommonLogger are middlewares that log all http requests and response in Apache CommonLog and CombinedLog formats. They also log the answer delay in ms.
These loggers are directly ported from gorilla handlers https://github.com/gorilla/handlers
CombinedLogger returns a middleware that logs HTTP requests to `out` Writer in combined log format
func CommonLogger ¶
func CommonLogger(out io.Writer) Middleware
CommonLogger returns a middleware that logs HTTP requests to `out` Writer in common log format
type ResponseWriterWrapper ¶
type ResponseWriterWrapper struct {
http.ResponseWriter
StatusCode int
Bytes int
// contains filtered or unexported fields
}
ResponseWriterWrapper wraps http.ResponseWriter to catch the status code and byte count. It implements the WriteHeader() and Write() interfaces from http.ResponseWriter.
func (*ResponseWriterWrapper) WriteHeader ¶
func (w *ResponseWriterWrapper) WriteHeader(status int)
Click to show internal directories.
Click to hide internal directories.