Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var LogRequests = NewRequestLogger(log.DefaultLogger).Middleware
LogRequests is a the default RequestLogger which will write to Stdout
Functions ¶
Types ¶
type RequestLogger ¶
type RequestLogger struct {
// contains filtered or unexported fields
}
RequestLogger creates a simple net/http middleware which captures metrics about a request/response and then logs it using the the specified Logger in aisola/log.
func NewRequestLogger ¶
func NewRequestLogger(l *log.Logger) *RequestLogger
NewRequestLogger creates a new request logger from a log.Logger from aisola/log.
func (*RequestLogger) Middleware ¶
func (rl *RequestLogger) Middleware(next http.Handler) http.Handler
Middleware returns the net/http middleware based on this RequestLogger.
Click to show internal directories.
Click to hide internal directories.