For the sake of scalability, I don't think we should log the receipt of every incoming webhook by default. If someone wants to inspect webhooks, they can always go see them in their dashboard. However, it might be useful when testing / debugging certain scenarios to have the receipt / processing of a webhook be logged chronologically to watchdog along with other log entries.

Let's add a checkbox option to the Stripe settings form I proposed in #3388427: Add the ability to turn off advanced fraud signals that reads, "Log the receipt of all Stripe webhooks." When we begin processing a webhook, we should log a notice to the watchdog reading, "Processing webhook.name webhook with ID webhook_id."

(If the menu / module settings form hasn't been made yet, make it in the context of resolving this ticket.)

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rszrama created an issue. See original summary.

rszrama’s picture

Note: when this setting is enabled, we should also use it to determine whether or not to log when an incoming webhook is not able to be matched against an existing payment.

vmarchuk made their first commit to this issue’s fork.

vmarchuk’s picture

Status: Active » Needs review
rszrama’s picture

Status: Needs review » Needs work

Let's rename the variable to log_webhooks to keep the same "verb_object" pattern as the other setting. I also don't see any harm in logging the receipt of any incoming webhook, even if it's of a type the module itself doesn't currently process. Could be useful for debugging or at least optimizing a webhook configuration in a Stripe account.

vmarchuk’s picture

Status: Needs work » Needs review

@rszrama

Let's rename the variable to log_webhooks to keep the same "verb_object" pattern as the other setting. I also don't see any harm in logging the receipt of any incoming webhook, even if it's of a type the module itself doesn't currently process. Could be useful for debugging or at least optimizing a webhook configuration in a Stripe account.

Both points are done.

tomtech’s picture

Status: Needs review » Closed (outdated)

Closing this out, since we now support logging webhooks with the webhook events submodule.