PHPackages                             klaravel/db-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. [Database &amp; ORM](/categories/database)
4. /
5. klaravel/db-logger

ActiveLibrary[Database &amp; ORM](/categories/database)

klaravel/db-logger
==================

Laravel database/sql queries logger.

v1.0.1(9y ago)132.4k1[2 issues](https://github.com/klaravel/db-logger/issues)MITPHP

Since Oct 3Pushed 9y ago4 watchersCompare

[ Source](https://github.com/klaravel/db-logger)[ Packagist](https://packagist.org/packages/klaravel/db-logger)[ RSS](/packages/klaravel-db-logger/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Database Queries Logger for Laravel 5.3+
----------------------------------------

[](#database-queries-logger-for-laravel-53)

[![Build Status](https://camo.githubusercontent.com/f424d92437c89053f37ae5a10bd9be2ad8ce5b6092210b8c8ee4f970527f4a4f/68747470733a2f2f7472617669732d63692e6f72672f6b6c61726176656c2f64622d6c6f676765722e737667)](https://travis-ci.org/klaravel/db-logger)[![Total Downloads](https://camo.githubusercontent.com/fdec43fada583ccae0197daf1ab3340de6950db95e4d43c9d5ff8110e9f9f159/68747470733a2f2f706f7365722e707567782e6f72672f6b6c61726176656c2f64622d6c6f676765722f642f746f74616c2e737667)](https://packagist.org/packages/klaravel/db-logger)[![Latest Stable Version](https://camo.githubusercontent.com/19b4da8695dcf10e0f2b5b9915e8b03fb84176ee1d54469de6931e14bc24c731/68747470733a2f2f706f7365722e707567782e6f72672f6b6c61726176656c2f64622d6c6f676765722f762f737461626c652e737667)](https://packagist.org/packages/klaravel/db-logger)[![Latest Unstable Version](https://camo.githubusercontent.com/ac4032cab49c5416c210b8f448f32a573cda00ff8345bebdf874f9c745011ac5/68747470733a2f2f706f7365722e707567782e6f72672f6b6c61726176656c2f64622d6c6f676765722f762f756e737461626c652e737667)](https://packagist.org/packages/klaravel/db-logger)[![License](https://camo.githubusercontent.com/ae64b345f35cba790410a4829561efa19320325796e7dc34d0247fdff143fed0/68747470733a2f2f706f7365722e707567782e6f72672f6b6c61726176656c2f64622d6c6f676765722f6c6963656e73652e737667)](https://packagist.org/packages/klaravel/db-logger)

This module allows you to log SQL queries (and slow SQL queries) to log file in Laravel framework. It's useful mainly when developing your application to verify whether your queries are valid and to make sure your application doesn't run too many or too slow database queries.

### Installation:

[](#installation)

1. Run

    ```
    composer require klaravel/db-logger
    ```

    in console to install this module
2. Open `config/app.php` and in `providers` section add:

    ```
    Klaravel\DbLogger\ServiceProvider::class,
    ```
3. Run:

    ```
    php artisan vendor:publish --provider="Klaravel\DbLogger\ServiceProvider"
    ```

    in your console to publish default configuration files
4. Open `config/dblogger.php` file and adjust settings to your need (by default it uses `.env` file so you can skip this step if you want).
5. In your .env file add the following entries:

    ```
    DB_LOG_QUERIES=true  # if not needed make it false
    DB_LOG_SLOW_QUERIES=true # if not needed make it false
    DB_SLOW_QUERIES_MIN_EXEC_TIME=100
    DB_LOG_OVERRIDE=false
    DB_LOG_DIRECTORY=logs/db
    DB_CONVERT_TIME_TO_SECONDS=false
    DB_LOG_SEPARATE_ARTISAN=false

    ```

    and adjust values to your needs. If you have also `.env.sample` it's also recommended to add those entries also in `.env.sample` file just to make sure everyone know about those env variables. Be aware that `DB_LOG_DIRECTORY` is directory inside storage directory. If you want you can change it editing `config/dblogger.php` file.

---

#### Note:

[](#note)

> Make sure defined `DB_LOG_DIRECTORY` directory should be exists default direcotry is `\storage\logs\db\` else application will throw error.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 83.3% 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 ~0 days

Total

2

Last Release

3515d ago

### Community

Maintainers

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

---

Top Contributors

[![ajmerainfo](https://avatars.githubusercontent.com/u/5574954?v=4)](https://github.com/ajmerainfo "ajmerainfo (5 commits)")[![keyur-spinx](https://avatars.githubusercontent.com/u/63884017?v=4)](https://github.com/keyur-spinx "keyur-spinx (1 commits)")

---

Tags

loglaravelsqldbloggersql loggerdb-logger

### Embed Badge

![Health badge](/badges/klaravel-db-logger/health.svg)

```
[![Health](https://phpackages.com/badges/klaravel-db-logger/health.svg)](https://phpackages.com/packages/klaravel-db-logger)
```

###  Alternatives

[mnabialek/laravel-sql-logger

Log SQL queries in Laravel/Lumen framework

158796.3k2](/packages/mnabialek-laravel-sql-logger)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[danielme85/laravel-log-to-db

Custom Laravel Log channel handler that can store log events to SQL or MongoDB databases. Uses Laravel native logging functionality.

135934.5k1](/packages/danielme85-laravel-log-to-db)[illuminated/db-profiler

Database Profiler for Laravel Web and Console Applications.

168237.4k](/packages/illuminated-db-profiler)[cybercog/laravel-clickhouse

ClickHouse migrations for Laravel

163166.8k](/packages/cybercog-laravel-clickhouse)[panique/pdo-debug

A super-simple function that returns the full SQL query from your PDO statements

70106.5k3](/packages/panique-pdo-debug)

PHPackages © 2026

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