PHPackages                             philippelamny/monolog-db - 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. philippelamny/monolog-db

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

philippelamny/monolog-db
========================

Laravel 6.x Monolog custom database channel

v1.3(5y ago)02.7k1MITPHPPHP ^7.4

Since Apr 19Pushed 5y agoCompare

[ Source](https://github.com/philippelamny/monolog-db)[ Packagist](https://packagist.org/packages/philippelamny/monolog-db)[ Docs](https://github.com/philippelamny/monolog-db)[ RSS](/packages/philippelamny-monolog-db/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (4)Used By (0)

Laravel 6.x Monolog Database Handler.
-------------------------------------

[](#laravel-6x-monolog-database-handler)

This package will log errors into a database instead storage/log/laravel.log file.

### Installation

[](#installation)

```
composer require philippelamny/monolog-db

```

Open up `config/logging.php` and find the `channels` key. Add the following channel to the list.

```
'database' => [
    'driver' => 'custom',
    'via'=> \Logger\DatabaseLogger::class,
    'table'=> env('DB_LOG_TABLE', 'logs'),
    'connection' => env('DB_LOG_CONNECTION', env('DB_CONNECTION', 'mysql')),
],

```

Set up Environment Variables (see Below).

Migrate the tables.

```
php artisan migrate

```

Database Engines
----------------

[](#database-engines)

Make sure before you migrate the table that you have set the envirment veriable for the database engine. This is done by adding the following line to the `.env` file

```
DB_LOG_ENGINE=InnoDB

```

To use the whatever the default database engine is or to specify no database engine during the table migration use the following

```
DB_LOG_ENGINE=NONE

```

Environment configuration
-------------------------

[](#environment-configuration)

If you wish to change default table name to write the log into add the following definition in your `.env` file

```
DB_LOG_TABLE=logs

```

To change the database connection that is used to wright the logs add the following definition to your `.env` file

```
DB_LOG_CONNECTION=mysql

```

To make sure you are using the `database` channel for logging add it to the stack in your `config\logging.php` or change the following in your `.env` file

```
LOG_CHANNEL=database

```

Credits
-------

[](#credits)

Based on:

- \[Mark Hilton\] ()
- \[Pedro Fornaza\] ()

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 53.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 ~1067 days

Total

2

Last Release

1877d ago

PHP version history (2 changes)v1.2PHP ^7.1.3

v1.3PHP ^7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/38346610?v=4)[philippe lam](/maintainers/philippelamny)[@philippelamny](https://github.com/philippelamny)

---

Top Contributors

[![gordonzero](https://avatars.githubusercontent.com/u/9784991?v=4)](https://github.com/gordonzero "gordonzero (7 commits)")[![philippelamny](https://avatars.githubusercontent.com/u/38346610?v=4)](https://github.com/philippelamny "philippelamny (6 commits)")

---

Tags

loglaraveldatabasemonologlaravel6

### Embed Badge

![Health badge](/badges/philippelamny-monolog-db/health.svg)

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

###  Alternatives

[wazaari/monolog-mysql

A handler for Monolog that sends messages to MySQL

140884.1k6](/packages/wazaari-monolog-mysql)[markhilton/monolog-mysql

Laravel 8 MySQL driver for Monolog

40140.8k](/packages/markhilton-monolog-mysql)[muhdfaiz/laravel-tail-db

Provide artisan command to monitor realtime database query executed from the application. Able to automatically run explain command for each of query received.

5826.7k](/packages/muhdfaiz-laravel-tail-db)[bradmkjr/monolog-wordpress

A handler for Monolog that sends messages to MySQL via WordPress Functions

2817.1k](/packages/bradmkjr-monolog-wordpress)

PHPackages © 2026

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