mirror of
https://github.com/Luzifer/go_helpers.git
synced 2024-12-25 05:21:20 +00:00
Also log query parameters
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
c3bea85c97
commit
f8065b8366
1 changed files with 6 additions and 1 deletions
|
@ -27,10 +27,15 @@ func (l HTTPLogHandler) ServeHTTP(res http.ResponseWriter, r *http.Request) {
|
|||
|
||||
l.Handler.ServeHTTP(ares, r)
|
||||
|
||||
path := r.URL.Path
|
||||
if q := r.URL.Query().Encode(); len(q) > 0 {
|
||||
path = path + "?" + q
|
||||
}
|
||||
|
||||
log.Printf("%s - \"%s %s\" %d %d \"%s\" \"%s\" %s",
|
||||
l.findIP(r),
|
||||
r.Method,
|
||||
r.URL.Path,
|
||||
path,
|
||||
ares.StatusCode,
|
||||
ares.Size,
|
||||
r.Header.Get("Referer"),
|
||||
|
|
Loading…
Reference in a new issue