PHPackages                             technoknol/log-my-queries - 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. technoknol/log-my-queries

Abandoned → [itsgoingd/clockwork](/?search=itsgoingd%2Fclockwork)Plugin[Logging &amp; Monitoring](/categories/logging)

technoknol/log-my-queries
=========================

Laravel middleware to Log all queries being fired to Laravel log file. Uses Laravel's default monolog library and sniffs Eloquent queries

v1.0.4(8y ago)06301MITPHPPHP ^5.5.9 || ^7.0

Since Jan 2Pushed 6y ago1 watchersCompare

[ Source](https://github.com/technoknol/LogMyQueries)[ Packagist](https://packagist.org/packages/technoknol/log-my-queries)[ Docs](http://shyammakwana.me)[ RSS](/packages/technoknol-log-my-queries/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (7)Used By (0)

LogMyQueries
============

[](#logmyqueries)

Laravel middleware to Log all queries being fired to Laravel log file. Uses Laravel's default monolog library and sniffs Eloquent queries

[![GitHub license](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://github.com/technoknol/LogMyQueries/blob/master/LICENCE)[![StyleCI](https://camo.githubusercontent.com/2a0bee6faa188aa454c503a839d48102e9503ffd2243ef0be86b9d136e0ab6e2/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3131313232363735342f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/111226754)

Install via composer
--------------------

[](#install-via-composer)

Run the following command to pull in the latest version:

```
composer require technoknol/log-my-queries

```

Add middleware
--------------

[](#add-middleware)

Add the middleware to the `$middleware` array in the `app/Http/Kernel.php` file as follows:

```
protected $middleware = [
        ...
        \technoknol\LogMyQueries\LogMyQueriesMiddleware::class
    ];

```

If you have `APP_DEBUG=true` and `APP_LOG_LEVEL=debug` you'll see all executed queries are being added in log file at `storage/logs/laravel.log`.

Example from laravel.log
------------------------

[](#example-from-laravellog)

```
[2018-01-02 09:20:26] local.DEBUG: LogMyQueries_STARTED
[2018-01-02 09:20:26] local.DEBUG: select * from "users" where "id" = 102 limit 1
[2018-01-02 09:20:26] local.DEBUG: LogMyQueries_STARTED
[2018-01-02 09:20:28] local.DEBUG: LogMyQueries_STARTED
[2018-01-02 09:20:28] local.DEBUG: select * from "users" where "id" = 102 limit 1
[2018-01-02 09:20:28] local.DEBUG: update "users" set "remember_token" = "1q8nbeh2k6MkneGz31DCJaVJd4H1cBroBBLs6yCfQUoGQaFBSuVLFt7Br7mr" where "id" = "102"

```

That's it. You're done.

###  Health Score

29

—

LowBetter than 63% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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

Every ~1 days

Total

5

Last Release

2997d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/312cea2bf5caa742e7e0055d61d181d40552166b21c831da8930d67e3a0a3eb9?d=identicon)[technoknol](/maintainers/technoknol)

---

Top Contributors

[![technoknol](https://avatars.githubusercontent.com/u/6429418?v=4)](https://github.com/technoknol "technoknol (21 commits)")

---

Tags

debuglaravellaravel-loglaravel-middlewarelogloggingphpquerylogphpmiddlewarelaravelloggingdebugqueryLaravel loglaravel middlewareLog queries

### Embed Badge

![Health badge](/badges/technoknol-log-my-queries/health.svg)

```
[![Health](https://phpackages.com/badges/technoknol-log-my-queries/health.svg)](https://phpackages.com/packages/technoknol-log-my-queries)
```

###  Alternatives

[hedii/laravel-gelf-logger

A Laravel package to send logs to a gelf compatible backend like graylog

1343.3M9](/packages/hedii-laravel-gelf-logger)[saasscaleup/laravel-log-alarm

Laravel log Alarm help you to set up alarm when errors occur in your system and send you a notification via Slack and email

27023.6k](/packages/saasscaleup-laravel-log-alarm)[ytake/laravel-fluent-logger

fluent logger for laravel and lumen

62538.4k1](/packages/ytake-laravel-fluent-logger)[phpconsole/phpconsole

A detached logging facility for PHP to aid your daily development routine

417.5k1](/packages/phpconsole-phpconsole)[moesif/moesif-laravel

Moesif Collection/Data Ingestion Middleware for Laravel

1064.9k](/packages/moesif-moesif-laravel)[kitloong/laravel-app-logger

Laravel log for your application

101.2M6](/packages/kitloong-laravel-app-logger)

PHPackages © 2026

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