From a99f4f3e475bb6813302c726f8346f268177669d Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Mon, 9 Mar 2015 17:01:47 -0700 Subject: [PATCH] Add user agent and source IP logging to the httpserver logs. --- pkg/httplog/log.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/httplog/log.go b/pkg/httplog/log.go index 21f01519184..619d22d3532 100644 --- a/pkg/httplog/log.go +++ b/pkg/httplog/log.go @@ -155,7 +155,7 @@ func (rl *respLogger) Addf(format string, data ...interface{}) { func (rl *respLogger) Log() { latency := time.Since(rl.startTime) if glog.V(2) { - glog.InfoDepth(1, fmt.Sprintf("%s %s: (%v) %v%v%v", rl.req.Method, rl.req.RequestURI, latency, rl.status, rl.statusStack, rl.addedInfo)) + glog.InfoDepth(1, fmt.Sprintf("%s %s: (%v) %v%v%v [%s %s]", rl.req.Method, rl.req.RequestURI, latency, rl.status, rl.statusStack, rl.addedInfo, rl.req.Header["User-Agent"], rl.req.RemoteAddr)) } }