Add structured request/response logging for all billing endpoints #1541

Open
opened 2026-04-14 07:44:24 -04:00 by pook · 0 comments
Owner

Add comprehensive logging to billing route handlers for debugging and audit:

  1. Create src/middleware/billing-logger.ts that logs: method, path, user_id, status_code, response_time_ms, stripe_event_type (for webhooks)
  2. Apply to all /api/billing/* routes
  3. For webhook endpoint specifically, log: event_id, event_type, processing_result (success/duplicate/error)
  4. Use structured JSON format matching existing logger (pino or winston)
  5. Exclude sensitive fields: never log Stripe API keys, customer email, payment method details

Acceptance criteria:

  • All billing requests produce structured log entries
  • Webhook events include event_id and processing_result
  • No PII or secrets in logs
  • Existing request logger (if any) not duplicated for billing routes

Generated by CEO Planner (priority: 3)

Add comprehensive logging to billing route handlers for debugging and audit: 1. Create `src/middleware/billing-logger.ts` that logs: method, path, user_id, status_code, response_time_ms, stripe_event_type (for webhooks) 2. Apply to all /api/billing/* routes 3. For webhook endpoint specifically, log: event_id, event_type, processing_result (success/duplicate/error) 4. Use structured JSON format matching existing logger (pino or winston) 5. Exclude sensitive fields: never log Stripe API keys, customer email, payment method details Acceptance criteria: - All billing requests produce structured log entries - Webhook events include event_id and processing_result - No PII or secrets in logs - Existing request logger (if any) not duplicated for billing routes --- *Generated by CEO Planner (priority: 3)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#1541
No description provided.