PHPackages                             juststeveking/eloquent-log-driver - 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. juststeveking/eloquent-log-driver

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

juststeveking/eloquent-log-driver
=================================

A Laravel Log Driver for Eloquent

1.2.0(5y ago)73.2k4[2 issues](https://github.com/JustSteveKing/eloquent-log-driver/issues)MITPHPPHP ~7.2CI failing

Since Feb 28Pushed 5y ago1 watchersCompare

[ Source](https://github.com/JustSteveKing/eloquent-log-driver)[ Packagist](https://packagist.org/packages/juststeveking/eloquent-log-driver)[ Docs](https://github.com/JustSteveKing/eloquent-log-driver)[ GitHub Sponsors](https://github.com/JustSteveKing)[ RSS](/packages/juststeveking-eloquent-log-driver/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (6)Dependencies (4)Versions (6)Used By (0)

Eloquent Log Driver
===================

[](#eloquent-log-driver)

[![Latest Version on Packagist](https://camo.githubusercontent.com/70c03ff83d24e64b766054b1fa326477cbef58ce7e2baa30b5a3039b75e4dcee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a75737473746576656b696e672f656c6f7175656e742d6c6f672d6472697665722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/juststeveking/eloquent-log-driver)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Quality Score](https://camo.githubusercontent.com/bcb5695ec8147803237f64da39fb76166c91d798cc01429b105a084e8bb75cf3/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f4a75737453746576654b696e672f656c6f7175656e742d6c6f672d6472697665722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/JustSteveKing/eloquent-log-driver)[![Total Downloads](https://camo.githubusercontent.com/f139438b8cfb6a46cab633aca36cb181e904c78344c8cd31df2b8340132bacad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a75737473746576656b696e672f656c6f7175656e742d6c6f672d6472697665722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/juststeveking/eloquent-log-driver)

A Laravel Log Driver for Eloquent

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

[](#installation)

Via Composer

```
$ composer require juststeveking/eloquent-log-driver
```

After installation, publish the migrations using:

Then we can run our migration, which will create a table called `database_logs`.

```
$ php artisan migrate
```

Registering the driver with Laravel
-----------------------------------

[](#registering-the-driver-with-laravel)

In your `.env` file add the following:

```
LOG_CHANNEL=eloquent
```

Then add the following to your `config/logging.php` file under channels:

```
'eloquent' => [
    'driver' => 'custom',
    'via' => \JustSteveKing\EloquentLogDriver\Logger\EloquentLogger::class
]
```

That is it! Your logs will now automatically start appearing in the database.

Querying Logs
-------------

[](#querying-logs)

There is a small selection of helper scope available on the `DatabaseLog` model:

- `whereDebug()`
- `whereInfo()`
- `whereNotice()`
- `whereWarning()`
- `whereError()`
- `whereCritical()`
- `whereAlert()`
- `whereEmergency()`
- `whereLevel('log-level-case-insensitive')`

All of the above will return an instance of an Eloquent Builder, allowing you to chain on further query parameters.

Testing
-------

[](#testing)

```
$ composer run test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Steve McDougall](https://github.com/JustSteveKing)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

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

Total

5

Last Release

2069d ago

### Community

Maintainers

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

---

Top Contributors

[![JustSteveKing](https://avatars.githubusercontent.com/u/6368379?v=4)](https://github.com/JustSteveKing "JustSteveKing (5 commits)")[![jamie-accessfertility](https://avatars.githubusercontent.com/u/73112329?v=4)](https://github.com/jamie-accessfertility "jamie-accessfertility (1 commits)")

---

Tags

loggingeloquentJustSteveKing

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/juststeveking-eloquent-log-driver/health.svg)

```
[![Health](https://phpackages.com/badges/juststeveking-eloquent-log-driver/health.svg)](https://phpackages.com/packages/juststeveking-eloquent-log-driver)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M96](/packages/mongodb-laravel-mongodb)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k32.6M46](/packages/kirschbaum-development-eloquent-power-joins)[spatie/laravel-sluggable

Generate slugs when saving Eloquent models

1.6k12.9M311](/packages/spatie-laravel-sluggable)[watson/validating

Eloquent model validating trait.

9803.5M54](/packages/watson-validating)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k332.0k1](/packages/cybercog-laravel-love)[spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

592456.3k2](/packages/spiritix-lada-cache)

PHPackages © 2026

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