summary refs log tree commit diff stats
path: root/http.go
diff options
context:
space:
mode:
Diffstat (limited to 'http.go')
-rw-r--r--http.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/http.go b/http.go
index aaa3a2e..f4ba233 100644
--- a/http.go
+++ b/http.go
@@ -53,9 +53,10 @@ func ipMiddleware(hop http.Handler) http.Handler {
 }
 
 func log200(r *http.Request) {
+	useragent := r.Header["User-Agent"]
 
 	uip := getIPFromCtx(r.Context())
-	log.Printf("*** %v :: 200 :: %v %v\n", uip, r.Method, r.URL)
+	log.Printf("*** %v :: 200 :: %v %v :: %v\n", uip, r.Method, r.URL, useragent)
 }
 
 func log400(w http.ResponseWriter, r *http.Request, err string) {
@@ -65,15 +66,17 @@ func log400(w http.ResponseWriter, r *http.Request, err string) {
 }
 
 func log404(w http.ResponseWriter, r *http.Request, err error) {
+	useragent := r.Header["User-Agent"]
 
 	uip := getIPFromCtx(r.Context())
-	log.Printf("*** %v :: 404 :: %v %v :: %v\n", uip, r.Method, r.URL, err)
+	log.Printf("*** %v :: 404 :: %v %v :: %v :: %v\n", uip, r.Method, r.URL, useragent, err)
 	http.Error(w, err.Error(), http.StatusNotFound)
 }
 
 func log500(w http.ResponseWriter, r *http.Request, err error) {
+	useragent := r.Header["User-Agent"]
 
 	uip := getIPFromCtx(r.Context())
-	log.Printf("*** %v :: 500 :: %v %v :: %v\n", uip, r.Method, r.URL, err)
+	log.Printf("*** %v :: 500 :: %v %v :: %v :: %v\n", uip, r.Method, r.URL, useragent, err)
 	http.Error(w, err.Error(), http.StatusInternalServerError)
 }
itter hut <hut@lavabit.com> 2010-06-18 17:11:54 +0200 Removed built-in support for uninstalling.' href='/akspecs/ranger/commit/INSTALL?h=v1.4.0&id=b06433bc03632ae0fe74381fa0a474d64b0fee94'>b06433bc ^
582f3519 ^
b06433bc ^
3edc9f86 ^
b06433bc ^
7582555b ^
84c49ab7 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23