MCPcopy Create free account
hub / github.com/ericls/imgdd / Log

Method Log

httpserver/common_middleware.go:94–107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92}
93
94func (l *loggingEntry) Log() {
95 httpLogger.Info().
96 Str("remote_ip", l.RemoteIP).
97 Str("proto", l.Proto).
98 Str("method", l.Method).
99 Str("host", l.HostName).
100 Str("port", l.Port).
101 Str("url", l.URL).
102 Str("referer", l.Referer).
103 Int("status_code", l.StatusCode).
104 Int64("size", l.Size).
105 Dur("duration", l.Duration).
106 Msg("http request")
107}
108
109func LoggerMiddleware(next http.Handler) http.Handler {
110 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

Callers 1

LoggerMiddlewareFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected