Skip to content

Commit

Permalink
Improve log format (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
tessus committed May 24, 2023
1 parent 8f51a2c commit a37afce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions router/router.go
Expand Up @@ -191,8 +191,8 @@ func logFormatter(param gin.LogFormatterParams) string {
param.Latency = param.Latency - param.Latency%time.Second
}
path := tokenRegexp.ReplaceAllString(param.Path, "token=[masked]")
return fmt.Sprintf("[GIN] %v |%s %3d %s| %13v | %15s |%s %-7s %s %#v\n%s",
param.TimeStamp.Format("2006/01/02 - 15:04:05"),
return fmt.Sprintf("%v |%s %3d %s| %13v | %15s |%s %-7s %s %#v\n%s",
param.TimeStamp.Format(time.RFC3339),
statusColor, param.StatusCode, resetColor,
param.Latency,
param.ClientIP,
Expand Down

0 comments on commit a37afce

Please sign in to comment.