Skip to content

Commit

Permalink
feat: take Correlation ID from req context when logging panics
Browse files Browse the repository at this point in the history
  • Loading branch information
Pitasi committed Mar 1, 2022
1 parent 05ebda1 commit dfd8bd1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ func (r *Router) catchPanicsFunc(c *gin.Context) {
errors.New("internal server error"),
http.StatusInternalServerError)

r.l.Errorw(
logger := logging.AddCorrelationIDToLogger(c, r.l)
logger.Errorw(
"panic handler triggered while handling call",
"endpoint", c.Request.RequestURI,
"error", fmt.Sprint(rval),
Expand Down

0 comments on commit dfd8bd1

Please sign in to comment.