Skip to content

Commit

Permalink
Log callback URL (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Selbach authored Aug 5, 2020
1 parent f221fe0 commit 20c26bc
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,13 @@ func (c *Client) ProvisionResource(ctx context.Context, cbID manifold.ID,
p.SetContext(ctx)

c.log.WithFields(logrus.Fields{
"url": c.url,
"resource_id": model.ID,
"platform_id": model.PlatformID,
"product": model.Product,
"plan": model.Plan,
"region": model.Region,
"url": c.url,
"callback_url": cbURL,
"resource_id": model.ID,
"platform_id": model.PlatformID,
"product": model.Product,
"plan": model.Plan,
"region": model.Region,
}).Info("Sending PUT resource/{id} request to provider")

res, acceptedRes, noContent, err := c.api.Resource.PutResourcesID(p)
Expand All @@ -160,7 +161,10 @@ func (c *Client) ProvisionResource(ctx context.Context, cbID manifold.ID,
return "", false, err
}

c.log.WithError(graftonErr).WithField("status_code", statusCode).Error("Received an error from provider")
c.log.WithError(graftonErr).WithFields(logrus.Fields{
"status_code": statusCode,
"callback_url": cbURL,
}).Error("Received an error from provider")
return graftonErr.Error(), false, graftonErr
}

Expand Down

0 comments on commit 20c26bc

Please sign in to comment.