PHPackages                             feyman/laravel-sql-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. feyman/laravel-sql-logger

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

feyman/laravel-sql-logger
=========================

A tool to log all queries for laravel/lumen application.

0.0.5(8y ago)45.8k1[1 issues](https://github.com/feymanlee/laravel-sql-logger/issues)MITPHP

Since Dec 24Pushed 8y ago1 watchersCompare

[ Source](https://github.com/feymanlee/laravel-sql-logger)[ Packagist](https://packagist.org/packages/feyman/laravel-sql-logger)[ RSS](/packages/feyman-laravel-sql-logger/feed)WikiDiscussions master Synced 2d ago

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

 Laravel Sql Logger
====================

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

📝 This package allows you to log SQL queries (and slow SQL queries) to log file in Laravel/Lumen framework. Inspiration form [mnabialek/laravel-sql-logger](https://github.com/mnabialek/laravel-sql-logger)

Installation
------------

[](#installation)

```
composer require feyman/laravel-sql-logger --dev
```

Please keep the `--dev` option. (it's recommended to use this package only for development). The Logger will be enabled when `APP_DEBUG` is true

Configuration
-------------

[](#configuration)

If you use Laravel &lt; 5.5 open `app/Providers/AppServiceProvider.php` and in `register` method add:

```
public function register()
{
    if ($this->app['config']->get('app.debug')) {
        $this->app->register(\Feyman\LaravelSqlLogger\Providers\ServiceProvider::class);
    }
}
```

> Laravel 5.5 uses Package Auto-Discovery and it will automatically load this service provider so you don't need to add anything into above file.

If you are using Lumen open `bootstrap/app.php` and add:

```
if (env('APP_DEBUG')) {
    $app->register(\Feyman\LaravelSqlLogger\Providers\LumenServiceProvider::class);
}
```

If you use Laravel &lt; 5.5 run:

```
php artisan vendor:publish --provider="Feyman\LaravelSqlLogger\Providers\ServiceProvider"
```

in your console to publish default configuration files.

#### If you are using Laravel 5.5 run:

[](#if-you-are-using-laravel-55-run)

```
php artisan vendor:publish
```

and choose the number matching `"Feyman\LaravelSqlLogger\Providers\ServiceProvider"` provider. This operation will create config file in `config/sql_loger.php`. By default you should not edit published file because all the settings are loaded from `.env` file by default.

For Lumen you should skip this step.

#### In your .env file add the following entries:

[](#in-your-env-file-add-the-following-entries)

```
# Whether all SQL queries should be logged
SQL_LOG_QUERIES=true

# Whether slow SQL queries should be logged (you can log all queries and
# also slow queries in separate file or you might to want log only slow queries)
SQL_LOG_SLOW_QUERIES=true

# Time of query (in milliseconds) when this query is considered as slow
SQL_SLOW_QUERIES_MIN_EXEC_TIME=100

#Whether slow SQL queries should be logged (you can log all queries and
#also slow queries in separate file or you might to want log only slow queries)
SQL_LOG_OVERRIDE=false

# Directory where log files will be saved
SQL_LOG_DIRECTORY=logs/sql

# Whether execution time in log file should be displayed in seconds(by default it's in milliseconds)
SQL_CONVERT_TIME_TO_SECONDS=false

# Whether artisan queries should be logged to separate files
SQL_LOG_SEPARATE_ARTISAN=false

```

License
-------

[](#license)

MIT

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~13 days

Total

4

Last Release

3022d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e5f5329e70cebc7601f3f0a8023429209b1638e80c065e837028294c38f1aad6?d=identicon)[Feyman](/maintainers/Feyman)

---

Top Contributors

[![Dylan-DPC](https://avatars.githubusercontent.com/u/99973273?v=4)](https://github.com/Dylan-DPC "Dylan-DPC (1 commits)")[![feymanlee](https://avatars.githubusercontent.com/u/14125552?v=4)](https://github.com/feymanlee "feymanlee (1 commits)")

---

Tags

laravelloggerquery-loggerquery loggerlaravel-sql-loggerlumen-query-loggerlog-query

### Embed Badge

![Health badge](/badges/feyman-laravel-sql-logger/health.svg)

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

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[beyondcode/laravel-server-timing

Add Server-Timing header information from within your Laravel apps.

5712.0M1](/packages/beyondcode-laravel-server-timing)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[kitloong/laravel-app-logger

Laravel log for your application

101.2M8](/packages/kitloong-laravel-app-logger)[label84/laravel-auth-log

Log user authentication actions in Laravel.

3654.0k](/packages/label84-laravel-auth-log)[shaffe/laravel-mail-log-channel

A package to support logging via email in Laravel

1286.2k](/packages/shaffe-laravel-mail-log-channel)

PHPackages © 2026

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