Skip to content

Commit

Permalink
fix: log the request_id from request header (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thearas authored Jun 11, 2022
1 parent 8f5ee9d commit 592e888
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ func ZapLogger(log *zap.Logger) echo.MiddlewareFunc {
id := req.Header.Get(echo.HeaderXRequestID)
if id == "" {
id = res.Header().Get(echo.HeaderXRequestID)
fields = append(fields, zap.String("request_id", id))
}
fields = append(fields, zap.String("request_id", id))

n := res.Status
switch {
Expand Down

0 comments on commit 592e888

Please sign in to comment.