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

Eloquent Logger Laravel Package

rstriquer/eloquent-logger

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Debugging & Performance Optimization:

    • Accelerate SQL query tuning by providing real-time query logging without manual instrumentation.
    • Reduce time spent on profiling slow queries in development (e.g., N+1 queries, inefficient joins).
    • Enable data teams to validate query correctness during feature development (e.g., complex Eloquent relationships).
  • Developer Experience (DX) Improvements:

    • Build vs. Buy: Avoid reinventing a query logger for Laravel/Eloquent (saves ~10–20 dev hours).
    • Onboarding: Standardize debugging workflows for junior engineers by logging queries to a predictable location (storage/logs).
    • Legacy Codebases: Simplify debugging in monolithic apps where query complexity is opaque (e.g., legacy migrations, stored procedures).
  • Roadmap Prioritization:

    • Tech Debt: Justify investing in query optimization as a high-impact area (e.g., "We’re seeing 30% slower queries in Module X; let’s log them").
    • Feature Flags: Pair with feature flags to toggle logging for specific user flows (e.g., "Log queries only for users in beta_testers group").
  • Use Cases:

    • Local Development: Automatically log queries during PR reviews to catch regressions.
    • CI/CD: Add to test suites to fail builds if queries exceed a threshold (e.g., >50ms avg. latency).
    • Auditing: Track query patterns during data migrations or schema changes.

When to Consider This Package

  • Adopt When:

    • Your team frequently debugs Eloquent queries and lacks a centralized logging solution.
    • You’re using Laravel/Eloquent and need development-only query visibility (not production-safe).
    • Your app has moderate query complexity (e.g., 100–1,000 queries/hour in dev; avoid if logging 10K+/hour).
    • You prioritize simplicity over advanced features (e.g., no need for query filtering, sampling, or real-time analysis).
  • Look Elsewhere If:

    • You need production-grade query logging (use tools like Laravel Debugbar, Blackfire, or New Relic).
    • Your app runs high-volume queries (risk of log file bloat; consider streaming to a database instead).
    • You require query filtering (e.g., log only SELECT queries or slow queries; this package logs all).
    • Your team uses raw SQL (outside Eloquent) or other ORMs (e.g., Doctrine).
    • You need historical analysis (this package doesn’t rotate logs; manual cleanup required).

How to Pitch It (Stakeholders)

For Executives:

"This package lets our dev team automatically log all SQL queries during development—like a flight recorder for database calls. It’s free, MIT-licensed, and saves hours of manual debugging. For example, when we launched Feature X, we used it to catch a slow N+1 query that was costing us 20% extra server load. Since it’s only for development, there’s no production risk. We’d turn it on for critical PR reviews or performance investigations, then disable it to avoid log bloat. It’s a low-effort way to improve query efficiency without adding technical debt."

Ask: "Would you prioritize this as a quick win for developer productivity?"


For Engineering Teams:

*"This is a drop-in Laravel package that logs all Eloquent queries to storage/logs/eloquent.log. Here’s why it’s useful:

  • No setup: Just install it in dev; no config changes needed.
  • Debugging: Instantly see exactly what SQL Eloquent generates (e.g., WHERE clauses, joins, or missing indexes).
  • Performance: Catch slow queries early—like this case where we found a LIKE '%term%' search that could use a full-text index.
  • Limitations: Only for dev, and logs can grow large if left on. We’ll monitor file size and turn it off after use.

Proposal: Let’s add this to our dev environment and document how to enable it for query investigations. It’s a 5-minute setup with high payoff."*

Ask: "Should we include this in our standard dev environment setup?"

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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope