PHPackages                             liyu/laravel-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. liyu/laravel-query-logger

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

liyu/laravel-query-logger
=========================

A dev tool to log all queries for laravel application.

1.0.8(6y ago)16MITPHP

Since Sep 7Pushed 5y agoCompare

[ Source](https://github.com/liyu001989/laravel-query-logger)[ Packagist](https://packagist.org/packages/liyu/laravel-query-logger)[ RSS](/packages/liyu-laravel-query-logger/feed)WikiDiscussions master Synced yesterday

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

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

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

 📝 A dev tool to log all queries for Laravel application.

Installing
----------

[](#installing)

```
$ composer require overtrue/laravel-query-logger --dev -vvv
```

Laravel Query Logger will be enabled when `LOG_QUERY` is `true`.

> Please keep the `--dev` option.

Usage
-----

[](#usage)

```
$ tail -f ./storage/logs/laravel.log
```

```
[2017-09-05 14:52:14] local.DEBUG: [800μs] select count(*) as aggregate from `discussions` where `discussions`.`deleted_at` is null | GET: http://laravel.app/discussions
[2017-09-05 14:52:14] local.DEBUG: [1.07ms] select * from `discussions` where `discussions`.`deleted_at` is null order by `is_top` desc, `created_at` desc limit 15 offset 0 | GET: http://laravel.app/discussions
[2017-09-05 14:52:14] local.DEBUG: [3.63s] select `tags`.*, `taggables`.`taggable_id` as `pivot_taggable_id`, `taggables`.`tag_id` as `pivot_tag_id` from `tags` inner join `taggables` on `tags`.`id` = `taggables`.`tag_id` where `taggables`.`taggable_id` in ('1', '2', '3', '4', '5', '6', '7', '8') and `taggables`.`taggable_type` = 'App\\Models\\Discussion' order by `order_column` asc | GET: http://laravel.app/discussions
[2017-09-05 14:52:14] local.DEBUG: [670μs] select * from `users` where `users`.`id` in ('1', '2', '4') and `users`.`deleted_at` is null | GET: http://laravel.app/discussions
...

```

### Configuration

[](#configuration)

If you want to use it in a environment, you can control whether or not to log a query via the configuration file：

*config/logging.php:*

```
return [
    //...
    'query' => [
        'enabled' => env('LOG_QUERY', false),

        // Only record queries that are slower than the following time
        // Unit: milliseconds
        'slower_than' => 0,
    ],
];
```

PHP 扩展包开发
---------

[](#php-扩展包开发)

> 想知道如何从零开始构建 PHP 扩展包？
>
> 请关注我的实战课程，我会在此课程中分享一些扩展开发经验 —— [《PHP 扩展包实战教程 - 从入门到发布》](https://learnku.com/courses/creating-package)

License
-------

[](#license)

MIT

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 68.8% 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 ~117 days

Recently: every ~96 days

Total

9

Last Release

2230d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4f209eb772df9da353f457ff3fe27cfbf9101574b27ace3ffe0304672584198e?d=identicon)[liyu](/maintainers/liyu)

---

Top Contributors

[![overtrue](https://avatars.githubusercontent.com/u/1472352?v=4)](https://github.com/overtrue "overtrue (33 commits)")[![liyu001989](https://avatars.githubusercontent.com/u/2981799?v=4)](https://github.com/liyu001989 "liyu001989 (3 commits)")[![YL20181120](https://avatars.githubusercontent.com/u/5860349?v=4)](https://github.com/YL20181120 "YL20181120 (2 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (2 commits)")[![seekerliu](https://avatars.githubusercontent.com/u/8923281?v=4)](https://github.com/seekerliu "seekerliu (2 commits)")[![bolechen](https://avatars.githubusercontent.com/u/195015?v=4)](https://github.com/bolechen "bolechen (2 commits)")[![ruchengtang](https://avatars.githubusercontent.com/u/1282479?v=4)](https://github.com/ruchengtang "ruchengtang (2 commits)")[![osindex](https://avatars.githubusercontent.com/u/4703215?v=4)](https://github.com/osindex "osindex (1 commits)")[![summerblue](https://avatars.githubusercontent.com/u/324764?v=4)](https://github.com/summerblue "summerblue (1 commits)")

### Embed Badge

![Health badge](/badges/liyu-laravel-query-logger/health.svg)

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

###  Alternatives

[overtrue/laravel-query-logger

A dev tool to log all queries for laravel application.

413307.5k6](/packages/overtrue-laravel-query-logger)[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14642.7k1](/packages/guanguans-laravel-exception-notify)[regulus/activity-log

A clean and simple Laravel 5 activity logger for monitoring user activity on a website or web application.

164220.1k2](/packages/regulus-activity-log)

PHPackages © 2026

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