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

ActiveLibrary

lingxi/laravel-sql-logger
=========================

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

0.0.3(8y ago)01.7kMITPHP

Since Jan 2Pushed 8y ago5 watchersCompare

[ Source](https://github.com/lingxi/laravel-sql-log)[ Packagist](https://packagist.org/packages/lingxi/laravel-sql-logger)[ RSS](/packages/lingxi-laravel-sql-logger/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)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 lingxi/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(\Lingxi\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(\Lingxi\LaravelSqlLogger\Providers\LumenServiceProvider::class);
}
```

If you use Laravel &lt; 5.5 run:

```
php artisan vendor:publish --provider="Lingxi\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 `"Lingxi\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

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

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 ~15 days

Total

3

Last Release

3017d ago

### Community

Maintainers

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

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

---

Tags

query loggerlaravel-sql-loggerlaravel-query-loggerlumen-query-logger

### Embed Badge

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

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

###  Alternatives

[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[rodrigopedra/laravel-query-logger

Laravel query logger

1211.8k](/packages/rodrigopedra-laravel-query-logger)

PHPackages © 2026

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