1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-05 00:58:47 +02:00

Updated logger docs

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2017-01-11 21:02:34 -08:00
parent ce6b1e20db
commit 0696d55586
3 changed files with 31 additions and 25 deletions

View File

@ -21,8 +21,7 @@ type (
// Availabe logger fields:
//
// - time_unix
// - time_rfc3339
// - time
// - id (Request ID - Not implemented)
// - remote_ip
// - uri
@ -121,7 +120,8 @@ func LoggerWithConfig(config LoggerConfig) echo.MiddlewareFunc {
for _, f := range config.Fields {
switch f {
case "time":
request.Time = time.Now()
t := time.Now()
request.Time = &t
case "remote_ip":
request.RemoteIP = c.RealIP()
case "host":