Monitoring and Observability

Webhook Logging and Error Tracking

Webhook failures are hard to debug because they happen asynchronously. If you do not record incoming events, response codes, errors, and retry patterns, production incidents quickly turn into guesswork.

Webhooks usually fail outside the normal user-facing flow of an application. A payment may not activate, a subscription may not update, or an automation may silently stop.

When that happens, developers need answers to a few basic questions:

  • Did the webhook reach the endpoint?
  • What payload was delivered?
  • What HTTP status code did the application return?
  • Did the provider retry the event?
  • What error happened during processing?

Logging and error tracking together make those answers available.

What to log for every webhook delivery

A useful webhook record should include more than just the raw payload.

  • provider name
  • event ID
  • event type
  • delivery timestamp
  • raw payload
  • HTTP response code
  • response time
  • processing status
  • last error message
  • retry count if known

With this data available, engineers can reconstruct what happened during a failure instead of relying on assumptions.

A simple Laravel logging pattern

A basic implementation stores the event before heavy processing begins.

                    
public function handle(Request $request)
{
    WebhookEvent::create([
        'provider' => 'stripe',
        'event_id' => $request->input('id'),
        'event_type' => $request->input('type'),
        'payload' => json_encode($request->all()),
        'status' => 'received',
        'received_at' => now(),
    ]);

    return response()->json(['received' => true]);
}
                    
                

This creates an event history that can later be linked to queue jobs, retries, and processing results.

Logging is not the same as error tracking

Logging records what happened. Error tracking explains where processing failed.

A good webhook observability setup usually captures both:

  • Logging — payloads, event IDs, timestamps, response codes
  • Error tracking — exceptions, failed jobs, processing failures, recurring patterns

Logging helps answer “did we receive it?” Error tracking helps answer “why did handling fail?”

Signals engineers should track

In production, developers usually investigate webhook failures by looking at a few recurring signals:

  • HTTP response status codes
  • response latency
  • retry attempts from the provider
  • queue job failures
  • incident frequency over time
  • time to recovery after a failure

These signals help separate infrastructure issues from application logic problems.

Why application-only logging has limits

Storing requests in your own database is useful, but it does not tell the full story.

Some failures happen before the request ever reaches the application:

  • timeouts at the edge
  • reverse proxy problems
  • TLS or DNS issues
  • provider retries caused by intermittent network failures

That is why many teams combine internal logging with webhook-specific monitoring.

A practical debugging workflow

  1. Confirm the webhook event was delivered.
  2. Inspect the recorded payload.
  3. Check the HTTP response returned by the endpoint.
  4. Look for retries or duplicate deliveries.
  5. Review queue workers, exceptions, and downstream failures.

Proper webhook logging and error tracking reduce the time needed to diagnose production incidents dramatically.

For broader debugging strategy, see our guide on webhook debugging in production .

If you want to focus specifically on missing events, also see how to detect when webhooks stop arriving .

Logging and error tracking are only one part of webhook observability. If you want to compare active monitoring approaches and what engineers should evaluate in production, see webhook monitoring tools .

If your question is whether normal uptime checks are enough for webhook systems, read webhook monitoring vs uptime monitoring .

Related guides:

Start monitoring your webhook endpoints →