Skip to content

Commit

Permalink
Split (potentially sensitive) details to a trace-level log
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Jun 23, 2023
1 parent 88890b0 commit 98cfd38
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/http/interceptors/log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ func writeLog(log *zerolog.Logger, req *http.Request, url url.URL, ts time.Time,
default:
event = log.Error()
}
event.Str("host", host).Str("method", req.Method).Str("uri", uri).Int("status", status).
Msg("processed http request")

event.Str("host", host).Str("method", req.Method).
log.Trace().Str("host", host).Str("method", req.Method).
Str("uri", uri).Str("proto", req.Proto).Interface("req_headers", req.Header).
Int("status", status).Int("size", size).Interface("res_headers", resHeaders).
Str("start", ts.Format("02/Jan/2006:15:04:05 -0700")).
Expand Down

0 comments on commit 98cfd38

Please sign in to comment.