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 Log Dumper Laravel Package

spatie/laravel-log-dumper

Adds an ld() helper to dump any values to your Laravel application log using Symfony VarDumper formatting. Log multiple arguments, choose or chain log levels (info/debug/error/etc.), and enable/disable logging when needed.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Debugging & Observability: Accelerates development cycles by enabling quick, structured logging of complex data (objects, arrays, exceptions) without manual serialization. Reduces reliance on dd() or var_dump() in production-like environments.
  • Developer Experience (DX): Aligns with Laravel’s ecosystem, reducing cognitive load for teams already using Spatie packages. Enables consistent logging practices across microservices or monoliths.
  • Roadmap for Debugging Tools: Justifies investment in a unified logging strategy (e.g., integrating with ELK, Datadog, or custom dashboards) by standardizing how data is logged early in the pipeline.
  • Build vs. Buy: Avoids reinventing logging utilities; leverages battle-tested VarDumper under the hood. Low maintenance cost with MIT license and active Spatie support.
  • Use Cases:
    • Debugging edge cases in production (e.g., logging entire request payloads or user objects).
    • Replacing dd() in staging/pre-prod to avoid accidental data leaks.
    • Auditing complex workflows (e.g., logging state transitions in state machines).
    • Enabling feature flags or A/B tests by logging variant data.

When to Consider This Package

  • Look Elsewhere If:
    • You need structured logging (e.g., JSON output for SIEM tools): This package dumps raw strings; pair with a formatter like monolog or laravel-logging.
    • You require performance-critical paths: ld() adds overhead; avoid in high-frequency loops (e.g., API rate-limiting checks).
    • Your team prefers built-in Laravel tools: Native Log::debug() or Log::info() suffice for simple cases, though lack VarDumper’s depth.
    • You’re logging sensitive data: No built-in redaction; use in dev/staging only or wrap with sanitization.
    • You need log retention/archiving: This is a dev tool; pair with a dedicated logging service (e.g., Papertrail, Sentry).
  • Adopt If:
    • Your team frequently debugs complex PHP objects/arrays.
    • You lack a centralized logging strategy but want to standardize debugging output.
    • You’re using other Spatie packages (reduces vendor sprawl).

How to Pitch It (Stakeholders)

For Executives: "This package lets our devs log any data—objects, arrays, exceptions—with a single function call (ld()), replacing error-prone var_dump() or dd(). It’s like a ‘supercharged’ Log::debug() that auto-formats complex data for debugging. Low risk (MIT license, Spatie-backed), high reward: faster issue resolution and cleaner codebases. We can pilot it in staging to replace dd() calls, then expand to production-like environments for critical workflows. Estimated payback: 2–4 weeks of dev time saved per quarter."

For Engineering: *"Spatie’s laravel-log-dumper gives us ld(), a drop-in function that dumps any variable to logs using Symfony’s VarDumper—no manual serialization needed. Key benefits:

  • Consistency: Standardizes how we log complex data across services.
  • Speed: Replaces dd() in non-production; avoids accidental data leaks.
  • Integration: Works with existing Laravel logging (Monolog) or can feed into tools like Sentry.
  • Maintenance: MIT license, minimal overhead, and Spatie’s support. Proposal: Add to our dev dependencies, document ld() as the preferred debugging tool, and phase out var_dump()/dd() in shared codebases. Pair with a log-retention policy for sensitive data."*
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