| 92 | } |
| 93 | |
| 94 | func (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 | |
| 109 | func LoggerMiddleware(next http.Handler) http.Handler { |
| 110 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |