Commit 822c231f authored by Matthew Holt's avatar Matthew Holt

Renamed {time} placeholder to {when}

parent 24fc2ae5
...@@ -61,7 +61,7 @@ func RequestLog(p parser) Middleware { ...@@ -61,7 +61,7 @@ func RequestLog(p parser) Middleware {
const ( const (
defaultLogFilename = "access.log" defaultLogFilename = "access.log"
commonLogFormat = `{remote} ` + emptyStringReplacer + ` [{time}] "{method} {uri} {proto}" {status} {size}` commonLogFormat = `{remote} ` + emptyStringReplacer + ` [{when}] "{method} {uri} {proto}" {status} {size}`
combinedLogFormat = commonLogFormat + ` "{>Referer}" "{>User-Agent}"` combinedLogFormat = commonLogFormat + ` "{>Referer}" "{>User-Agent}"`
defaultReqLogFormat = commonLogFormat defaultReqLogFormat = commonLogFormat
) )
...@@ -45,7 +45,7 @@ func newReplacer(r *http.Request, rw *responseRecorder) replacer { ...@@ -45,7 +45,7 @@ func newReplacer(r *http.Request, rw *responseRecorder) replacer {
return "" return ""
}(), }(),
"{uri}": r.RequestURI, "{uri}": r.RequestURI,
"{time}": func() string { "{when}": func() string {
return time.Now().Format(timeFormat) return time.Now().Format(timeFormat)
}(), }(),
"{status}": strconv.Itoa(rw.status), "{status}": strconv.Itoa(rw.status),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment