Add TO Golang log unauthorized request reason

Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/67f80faf
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/67f80faf
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/67f80faf

Branch: refs/heads/master
Commit: 67f80fafe05d645d2b30ce32737a57aafe983044
Parents: 128c6a2
Author: Robert Butts <robert.o.bu...@gmail.com>
Authored: Thu Jul 27 11:30:03 2017 -0600
Committer: Dewayne Richardson <dewr...@apache.org>
Committed: Thu Aug 10 09:46:03 2017 -0600

----------------------------------------------------------------------
 traffic_ops/traffic_ops_golang/wrappers.go | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/67f80faf/traffic_ops/traffic_ops_golang/wrappers.go
----------------------------------------------------------------------
diff --git a/traffic_ops/traffic_ops_golang/wrappers.go 
b/traffic_ops/traffic_ops_golang/wrappers.go
index 39137ac..66af5d9 100644
--- a/traffic_ops/traffic_ops_golang/wrappers.go
+++ b/traffic_ops/traffic_ops_golang/wrappers.go
@@ -59,6 +59,7 @@ func wrapAuth(h RegexHandlerFunc, noAuth bool, secret string, 
privLevelStmt *sql
                        status := http.StatusUnauthorized
                        w.WriteHeader(status)
                        fmt.Fprintf(w, http.StatusText(status))
+                       log.Infof("%v %v %v %v returned unauthorized: %v\n", 
r.RemoteAddr, r.Method, r.URL.Path, username, reason)
                }
 
                cookie, err := r.Cookie(tocookie.Name)

Reply via email to