author | Alberto Bertogli
<albertito@blitiri.com.ar> 2025-06-06 09:48:02 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2025-06-06 09:48:02 UTC |
parent | 93594c609fb53a49009345c7258747a63b911425 |
reqlog/reqlog.go | +2 | -1 |
diff --git a/reqlog/reqlog.go b/reqlog/reqlog.go index 8e41ce6..82af810 100644 --- a/reqlog/reqlog.go +++ b/reqlog/reqlog.go @@ -61,7 +61,8 @@ const lighttpdFormat = "{{.H.RemoteAddr}} {{.H.Host}} - [{{.T.Format \"02/Jan/20 // gofer format, this is the default, and can handle both raw and HTTP events. const goferFormat = "{{.T.Format \"2006-01-02 15:04:05.000\"}}" + - "{{if .H}} {{.H.RemoteAddr}} {{.H.Proto}} {{.H.Host}} {{.H.Method}}" + + "{{if .H}} {{.H.RemoteAddr}} {{.H.Proto}}" + + " {{if .H.Host}}{{.H.Host}}{{else}}-{{end}} {{.H.Method}}" + " {{.H.URL}} {{.H.Header.Referer|q}} {{index .H.Header \"User-Agent\"|q}}{{end}}" + "{{if .R}} {{.R.RemoteAddr}} raw {{.R.LocalAddr}}{{end}}" + " = {{.Status}} {{.Length}}b {{.Latency.Milliseconds}}ms\n"