From 822c231f1c8aa94ffbe45108b0529148c8181cd1 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Mon, 19 Jan 2015 17:12:38 -0700 Subject: [PATCH] Renamed {time} placeholder to {when} --- middleware/log.go | 2 +- middleware/util_replacer.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/middleware/log.go b/middleware/log.go index e8ce81dd..f47dbe4e 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 1f15e8a2..32a24dd1 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),