Skip to content

Commit

Permalink
fix: gin log json
Browse files Browse the repository at this point in the history
  • Loading branch information
tyzbit committed May 3, 2022
1 parent e29d430 commit 092bb9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion init.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (w *Watcher) InitLogging() {
}

func GinJSONFormatter(param gin.LogFormatterParams) string {
jsonFormat := `{"time":"%s","clientip":"%s","method":"%s","uri":"%s","status":%3d,"latency":"%v","message":"%s","host":"%s","useragent":"%s","proto","%s","error_msg":"%s","size":%d}` + "\n"
jsonFormat := `{"time":"%s","clientip":"%s","method":"%s","uri":"%s","status":%3d,"latency":"%v","message":"%s","host":"%s","useragent":"%s","proto":"%s","error_msg":"%s","size":%d}` + "\n"
return fmt.Sprintf(jsonFormat,
param.TimeStamp.Format(TimeFormatter),
param.ClientIP,
Expand Down

0 comments on commit 092bb9c

Please sign in to comment.