From 8e80a224931cd7f42e9a658901826fe6b05ccdf6 Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Thu, 27 Apr 2017 14:55:31 -0700 Subject: [PATCH] Remove RequestTime and ResponseTime from WFE log (#2708) Fixes #2707. --- wfe/context.go | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/wfe/context.go b/wfe/context.go index c202de8e2..fb2fcc3c2 100644 --- a/wfe/context.go +++ b/wfe/context.go @@ -4,7 +4,6 @@ import ( "encoding/json" "fmt" "net/http" - "time" "golang.org/x/net/context" @@ -14,13 +13,11 @@ import ( ) type requestEvent struct { - ID string `json:",omitempty"` - RealIP string `json:",omitempty"` - ClientAddr string `json:",omitempty"` - Endpoint string `json:",omitempty"` - Method string `json:",omitempty"` - RequestTime time.Time `json:",omitempty"` - ResponseTime time.Time `json:",omitempty"` + ID string `json:",omitempty"` + RealIP string `json:",omitempty"` + ClientAddr string `json:",omitempty"` + Endpoint string `json:",omitempty"` + Method string `json:",omitempty"` Errors []string Requester int64 `json:",omitempty"` Contacts *[]string `json:",omitempty"` @@ -54,13 +51,12 @@ type topHandler struct { func (th *topHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { logEvent := &requestEvent{ - ID: core.NewToken(), - RealIP: r.Header.Get("X-Real-IP"), - ClientAddr: getClientAddr(r), - Method: r.Method, - RequestTime: time.Now(), - UserAgent: r.Header.Get("User-Agent"), - Extra: make(map[string]interface{}, 0), + ID: core.NewToken(), + RealIP: r.Header.Get("X-Real-IP"), + ClientAddr: getClientAddr(r), + Method: r.Method, + UserAgent: r.Header.Get("User-Agent"), + Extra: make(map[string]interface{}, 0), } w.Header().Set("Boulder-Request-ID", logEvent.ID) defer th.logEvent(logEvent) @@ -69,7 +65,6 @@ func (th *topHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } func (th *topHandler) logEvent(logEvent *requestEvent) { - logEvent.ResponseTime = th.clk.Now() var msg string if len(logEvent.Errors) != 0 { msg = "Terminated request"