PHPackages                             montross50/laravel-database-monologger - 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. montross50/laravel-database-monologger

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

montross50/laravel-database-monologger
======================================

Monolog package for laravel 5.\* to allow database logging.

1.3.0(7y ago)31.6k1[2 issues](https://github.com/montross50/laravel-database-monologger/issues)[1 PRs](https://github.com/montross50/laravel-database-monologger/pulls)MITPHPPHP &gt;=7.1.3CI failing

Since Feb 15Pushed 4y ago2 watchersCompare

[ Source](https://github.com/montross50/laravel-database-monologger)[ Packagist](https://packagist.org/packages/montross50/laravel-database-monologger)[ Docs](https://github.com/montross50/laravel-database-monologger)[ RSS](/packages/montross50-laravel-database-monologger/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (8)Dependencies (6)Versions (12)Used By (0)

Laravel Monolog MySQL Handler.
------------------------------

[](#laravel-monolog-mysql-handler)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ed6cd0df0c78b8c4cc58ea0272f8ee0eef7c2e792f49f9b11badbfe70b12b3f7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f6e74726f737335302f6c61726176656c2d64617461626173652d6d6f6e6f6c6f676765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/montross50/laravel-database-monologger)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/868769b0ccf47a20d2c058ed3b4f88708e01c395494026fdbc7eebdfc0a38e43/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d6f6e74726f737335302f6c61726176656c2d64617461626173652d6d6f6e6f6c6f676765722e7376673f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://travis-ci.org/montross50/laravel-database-monologger)[![Total Downloads](https://camo.githubusercontent.com/4beedd1ffbf88173d3696f99870ab3ec5eebef3be30e82d5e45aab40d05c824d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6f6e74726f737335302f6c61726176656c2d64617461626173652d6d6f6e6f6c6f676765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/montross50/laravel-database-monologger)

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

### Installation

[](#installation)

```
composer require montross50/laravel-database-monologger

```

Migrate tables.

```
php artisan migrate

```

Application Integration
-----------------------

[](#application-integration)

In your application `config/logging.php` add the following to the channels array:

```
 'database' => [
     'driver' => 'custom',
     'via' => Montross50\DatabaseLogger\CreateDatabaseLogger::class,
     'level' => Monolog\Logger::DEBUG \\optional
  ]
```

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

[](#environment-configuration)

If you wish to change default table name to write the log into or database connection use following definitions in your .env file

```
DB_LOG_TABLE=laravel_logs
DB_LOG_CONNECTION=mysql
DB_LOG_EXCEPTION_LOG_LEVEL=alert //log level when there is some error writing the log
APP_LOG_NAME=unknown
DB_LOG_MAX_RECORD_LENGTH=65500 //number of characters before truncating log message and context

```

Alternatively you can publish the config file.

```
php artisan vendor:publish --provider="Montross50\DatabaseLogger\MonologDatabaseHandlerServiceProvider" --tag=config

```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- Trent Schmidt

Based on:

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

License
-------

[](#license)

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

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~56 days

Recently: every ~99 days

Total

8

Last Release

2656d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/26fd57a3cd2e5e126d0da83b969168f6fce20221ab46813ec38f080b08f11710?d=identicon)[montross50](/maintainers/montross50)

---

Top Contributors

[![montross50](https://avatars.githubusercontent.com/u/62939?v=4)](https://github.com/montross50 "montross50 (16 commits)")

---

Tags

loglaraveldatabasemysqllaravel5monologlaravel56laravel57laravel58

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/montross50-laravel-database-monologger/health.svg)

```
[![Health](https://phpackages.com/badges/montross50-laravel-database-monologger/health.svg)](https://phpackages.com/packages/montross50-laravel-database-monologger)
```

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k54.1M11.1k](/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.

134979.2k1](/packages/danielme85-laravel-log-to-db)[markhilton/monolog-mysql

Laravel 8 MySQL driver for Monolog

40146.5k](/packages/markhilton-monolog-mysql)

PHPackages © 2026

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