mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-20 03:47:54 +02:00
Log the actual remote addr in log lines
This commit is contained in:
parent
0990a9db18
commit
87d3dc4d97
@ -558,7 +558,7 @@ func withLogging(h func(http.ResponseWriter, *http.Request)) http.Handler {
|
|||||||
h(&lrw, r)
|
h(&lrw, r)
|
||||||
|
|
||||||
duration := time.Since(start)
|
duration := time.Since(start)
|
||||||
fmt.Printf("%s %s %#v %s %s %s\n", r.RemoteAddr, r.Method, r.RequestURI, getHishtoryVersion(r), duration.String(), byteCountToString(responseData.size))
|
fmt.Printf("%s %s %#v %s %s %s\n", getRemoteAddr(r), r.Method, r.RequestURI, getHishtoryVersion(r), duration.String(), byteCountToString(responseData.size))
|
||||||
}
|
}
|
||||||
return http.HandlerFunc(logFn)
|
return http.HandlerFunc(logFn)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user