Log response body in PostJSONWithTimeout error case (#40509)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or remove if NA --> # Checklist for submitter - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files) for more information. ## Testing - [ ] QA'd all new/changed functionality manually
This commit is contained in:
@@ -45,7 +45,7 @@ func (w *webhookLogWriter) Write(ctx context.Context, logs []json.RawMessage) er
|
||||
"url", server.MaskSecretURLParams(w.url),
|
||||
)
|
||||
|
||||
if err := server.PostJSONWithTimeout(ctx, w.url, payload); err != nil {
|
||||
if err := server.PostJSONWithTimeout(ctx, w.url, payload, w.logger.SlogLogger()); err != nil {
|
||||
level.Error(w.logger).Log(
|
||||
"msg", fmt.Sprintf("failed to send automation webhook to %s", server.MaskSecretURLParams(w.url)),
|
||||
"err", server.MaskURLError(err).Error(),
|
||||
|
||||
Reference in New Issue
Block a user