Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Http Logger Laravel Package

spatie/laravel-http-logger

Laravel middleware that logs incoming HTTP requests (payload, headers, etc.) to your configured log/channel, creating a safety net for critical form submissions and debugging. Includes toggleable enable flag plus customizable log profile and writer.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Compliance & Auditability: Enables logging of all HTTP requests (including payloads) for regulatory compliance (e.g., GDPR, HIPAA) or internal audits, reducing risk of undetected data breaches or tampering.
  • Debugging & Postmortems: Captures raw request data (headers, body, metadata) even after errors occur, accelerating root-cause analysis for critical user flows (e.g., failed payments, form submissions).
  • Security Incident Response: Acts as a forensic tool to reconstruct attacks or anomalies (e.g., CSRF, malformed payloads) by preserving original request context.
  • Roadmap Prioritization: Justifies investment in observability tools by demonstrating tangible ROI (e.g., "Reduce MTTR for critical bugs by 30% with full request logging").
  • Build vs. Buy: Avoids custom middleware development for logging, reducing technical debt while maintaining flexibility (e.g., custom log formats, storage backends).
  • Use Cases:
    • Lead generation forms (validate submissions against logs).
    • Payment processing (audit failed transactions).
    • API integrations (debug third-party payloads).
    • High-risk user actions (e.g., account deletions, admin operations).

When to Consider This Package

  • Adopt if:
    • Your Laravel app handles sensitive user data (e.g., PII, financial info) and needs a safety net for debugging/auditing.
    • You lack structured request logging and rely on vague error messages (e.g., "500 Internal Server Error").
    • Your team prioritizes postmortem efficiency for critical user flows (e.g., checkout, onboarding).
    • You’re already using Spatie’s ecosystem (e.g., Laravel packages) and want consistency.
  • Look elsewhere if:
    • You need real-time monitoring (use tools like Sentry, Datadog, or Laravel Telescope instead).
    • Your app is low-risk (e.g., public blog) and logging isn’t a priority.
    • You require advanced analytics (e.g., user behavior tracking) beyond request reconstruction.
    • Your infrastructure already has dedicated logging solutions (e.g., ELK stack) that this package doesn’t integrate with natively.

How to Pitch It (Stakeholders)

For Executives: "This package adds a lightweight but powerful safety net for our Laravel app—like a black box recorder for HTTP requests. For every user action (especially high-risk ones like payments or form submissions), we’ll automatically log the raw data sent to our server. This means if something goes wrong, we can instantly replay the exact request that caused it, slashing debugging time and reducing compliance risks. It’s a no-code solution that costs almost nothing to implement but could save thousands in postmortem hours or regulatory fines. Think of it as insurance for our backend."

For Engineering: *"Spatie’s laravel-http-logger is a battle-tested middleware that logs all incoming requests (headers, body, metadata) to Laravel’s default log channel. Key benefits:

  • Zero config for basic use: Just add the middleware to app/Http/Kernel.php.
  • Flexible storage: Logs to any channel (e.g., Monolog, database, external services).
  • Error resilience: Captures requests even after exceptions occur (e.g., failed validations).
  • Lightweight: Minimal overhead (~100ms per request, per benchmarks).
  • Extensible: Hook into Logging events to filter or transform logs. Use case: Drop this into your api.php or web.php middleware stack for critical routes. Pair with Laravel Telescope for a full observability suite."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport