- What is mll-lab/laravel-query-log used for?
- It records every SQL query executed by a Laravel application to a dedicated log, including bindings and execution time. Use it during development and debugging to spot slow, duplicated, or unexpected database access without a full profiler.
- How do I install laravel-query-log in a Laravel app?
- Install it with Composer using composer require mll-lab/laravel-query-log. Laravel auto-discovery should register the service provider; publish the package configuration if you need to change the log channel, ignored tables, or ignored connections.
- Which Laravel versions does laravel-query-log support?
- The provided release evidence shows v2.3.0 added Laravel 9 support in May 2022. No newer Laravel 10, 11, or 12 support is evidenced here, so check the repository and Composer constraints before installing into a newer application.
- How do I enable or disable query logging?
- The package is designed to have no overhead when disabled and is typically controlled through its configuration. Enable it in local or debugging environments, and leave it off in production unless you deliberately need query logging there.
- How does laravel-query-log group queries per request?
- It includes middleware that groups logged queries per request, so you can see which SQL ran during a specific HTTP request. Register or configure the middleware according to the package docs so entries are grouped correctly.
- Can I ignore specific tables or database connections?
- Yes, the package supports ignoring configurable tables and connections. Use the published config to exclude noisy or irrelevant queries so the log focuses on the database access you are investigating.
- Does laravel-query-log show query bindings and execution time?
- Yes, each log entry includes the SQL bindings and execution time. That lets you see the actual values used in the query and how long it took, which is useful for diagnosing slow or unexpectedly repeated queries.
- Does laravel-query-log add overhead in production?
- The package advertises no overhead when disabled, so keep it disabled outside debugging sessions. If you enable it in production, expect larger log files, performance costs, and possible exposure of sensitive bindings.
- How does it compare to Laravel Telescope or Debugbar?
- Laravel Query Log is a lightweight, log-focused way to capture SQL queries, bindings, and timing. Telescope and Debugbar provide broader debugging dashboards, while this package is narrower and writes to a configurable log channel.
- Is laravel-query-log actively maintained?
- The evidence shows a v2.3.0 release in May 2022 adding Laravel 9 support, but no later release data is provided. Check the GitHub repository for recent commits, newer releases, license details, and Laravel 10/11/12 compatibility before adopting it.