diff --git a/middleware/log.go b/middleware/log.go index e8ce81dd9..f47dbe4ed 100644 --- a/middleware/log.go +++ b/middleware/log.go @@ -61,7 +61,7 @@ func RequestLog(p parser) Middleware { const ( 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}"` defaultReqLogFormat = commonLogFormat ) diff --git a/middleware/util_replacer.go b/middleware/util_replacer.go index 1f15e8a2b..32a24dd19 100644 --- a/middleware/util_replacer.go +++ b/middleware/util_replacer.go @@ -45,7 +45,7 @@ func newReplacer(r *http.Request, rw *responseRecorder) replacer { return "" }(), "{uri}": r.RequestURI, - "{time}": func() string { + "{when}": func() string { return time.Now().Format(timeFormat) }(), "{status}": strconv.Itoa(rw.status),