Renamed {time} placeholder to {when}

This commit is contained in:
Matthew Holt 2015-01-19 17:12:38 -07:00
parent 24fc2ae59e
commit 822c231f1c
2 changed files with 2 additions and 2 deletions

View file

@ -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
)

View file

@ -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),