PHPackages                             rezakia/slow-query-logger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. rezakia/slow-query-logger

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

rezakia/slow-query-logger
=========================

A Laravel package to log slow database queries.

v1.0.0(1y ago)01MITPHPPHP &gt;=8.0

Since Jun 28Pushed 1y agoCompare

[ Source](https://github.com/rezakiamanesh/laravel-slow-query-logger)[ Packagist](https://packagist.org/packages/rezakia/slow-query-logger)[ RSS](/packages/rezakia-slow-query-logger/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

Laravel Slow Query Logger
=========================

[](#laravel-slow-query-logger)

A Laravel package to log **slow SQL queries** for performance analysis and debugging.

[![Packagist Version](https://camo.githubusercontent.com/cca74dfee8877a01345b413ca23b6f3bcda4ad39c33f736a4f30c4eb6105c099/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72657a616b69616d616e6573682f6c61726176656c2d736c6f772d71756572792d6c6f67676572)](https://camo.githubusercontent.com/cca74dfee8877a01345b413ca23b6f3bcda4ad39c33f736a4f30c4eb6105c099/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72657a616b69616d616e6573682f6c61726176656c2d736c6f772d71756572792d6c6f67676572)[![License](https://camo.githubusercontent.com/45fb9e1fbe51c28f83e767ec727e362e3e09c507e89c0d66419bf96417f9cbcd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f72657a616b69616d616e6573682f6c61726176656c2d736c6f772d71756572792d6c6f67676572)](https://camo.githubusercontent.com/45fb9e1fbe51c28f83e767ec727e362e3e09c507e89c0d66419bf96417f9cbcd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f72657a616b69616d616e6573682f6c61726176656c2d736c6f772d71756572792d6c6f67676572)

---

📦 Installation
--------------

[](#-installation)

You can install the package via Composer:

```
composer require rezakia/slow-query-logger
```

⚙️ Configuration
----------------

[](#️-configuration)

You can publish the config file with:

```
php artisan vendor:publish --tag=slow-query-logger-config
```

This is the content of the published config file:

```
return [
'enabled' => true,
'threshold_ms' => 100, // Minimum time (in ms) for a query to be considered slow
'log_path' => storage_path('logs/slow-queries.log'),
];
```

🧪 Testing
---------

[](#-testing)

Run tests using:

```
./vendor/bin/phpunit | php artisan test
```

Or if using Testbench:

```
vendor/bin/testbench
```

🚀 Usage
-------

[](#-usage)

Once installed, the package automatically logs slow queries. You can view them in the log file specified in your config.

Each log entry contains:

User ID (or guest)

Request method and URL

Route name

SQL query and bindings

Execution time

✅ Example Log
-------------

[](#-example-log)

```
[2025-06-28 11:12:13]
User: 1 | IP: 127.0.0.1 | Method: GET | URL: http://localhost/users | Route: users.index
Slow Query (350ms): SELECT * FROM users WHERE email = ? | Bindings: ["test@example.com"]
--------------------------------------------------------------------------------------

```

📄 License
---------

[](#-license)

MIT © Reza Kiamanesh

- `rezakiamanesh`
- `reza kia`

---

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance49

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

370d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/19993234?v=4)[rezakia](/maintainers/rezakia)[@rezakia](https://github.com/rezakia)

---

Top Contributors

[![rezakiamanesh](https://avatars.githubusercontent.com/u/44573468?v=4)](https://github.com/rezakiamanesh "rezakiamanesh (1 commits)")

### Embed Badge

![Health badge](/badges/rezakia-slow-query-logger/health.svg)

```
[![Health](https://phpackages.com/badges/rezakia-slow-query-logger/health.svg)](https://phpackages.com/packages/rezakia-slow-query-logger)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M165](/packages/spatie-laravel-health)[illuminate/log

The Illuminate Log package.

6225.3M622](/packages/illuminate-log)[spatie/laravel-flare

Send Laravel errors to Flare

111.4M7](/packages/spatie-laravel-flare)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
