PHPackages                             anthonyedmonds/laravel-database-log - 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. anthonyedmonds/laravel-database-log

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

anthonyedmonds/laravel-database-log
===================================

Store your Laravel logs in the database

2.2.0(4mo ago)05.2k↓73.9%MITPHPPHP ^8

Since Sep 5Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/AnthonyEdmonds/laravel-database-log)[ Packagist](https://packagist.org/packages/anthonyedmonds/laravel-database-log)[ Docs](https://github.com/AnthonyEdmonds/laravel-database-log)[ RSS](/packages/anthonyedmonds-laravel-database-log/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (10)Dependencies (10)Versions (14)Used By (0)

Laravel Database Log
====================

[](#laravel-database-log)

Store your Laravel logs in the database!

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

[](#installation)

1. Add the library using Composer: ```
    composer require anthonyedmonds/laravel-database-log

    ```
2. The service provider will be automatically registered. If required, you can manually register the service provider by adding it to your `bootstrap/providers.php`: ```
    return [
        ...
        AnthonyEdmonds\LaravelDatabaseLog\DatabaseLogServiceProvider::class,
        ...
    ];

    ```
3. Publish the database migration and config files using Artisan: ```
    php artisan vendor:publish --provider="AnthonyEdmonds\LaravelDatabaseLog\DatabaseLogServiceProvider"

    ```
4. Add a log channel to 'config/logging.php' based on the following: ```
    'channels' => [
        ...
        'database' => [
            'driver' => 'monolog',
            'handler' => AnthonyEdmonds\LaravelDatabaseLog\Handler::class,
            'with' => [
                'fallback' => 'daily',
            ],
            'level' => env('LOG_LEVEL', 'debug'),
        ],
        ...
    ],

    ```

    - The `fallback` parameter is optional, and can point to a log to use in case the database cannot be reached.
    - The `level` parameter can be excluded if desired.

Configuration
-------------

[](#configuration)

The configuration found at `config/database-log.php` allows you to customise the following:

FieldDefaultPurposemodelAnthonyEdmonds\\LaravelDatabaseLog\\LogThe class name of the model to use for storing logs in the databasetablelogsThe name of the table used to store database logsCleaning up old logs
--------------------

[](#cleaning-up-old-logs)

### Job

[](#job)

A Laravel Job is provided to cleanup old logs.

Add the job to your schedule, providing the number of days after which logs should be deleted.

```
$schedule
    ->job(new CleanupLogsJob())
    ->daily();
```

### Command

[](#command)

The `database-log:cleanup` command is also provided to remove old logs from the database as required.

You can provide the number of days after which logs should be deleted as part of the command.

```
php artisan database-log:cleanup 14
```

You can also schedule the command to run automatically by adding it to your scheduler:

```
$schedule
   ->command('database-log:cleanup 90')
   ->daily();

```

Usage
-----

[](#usage)

Whenever Laravel creates a log, whether manually or when exceptions are thrown, a new Log will be created in the database.

You are free to use those Logs in whatever fashion you see fit; no UI or other restrictions are provided by this library.

Issues and feedback
-------------------

[](#issues-and-feedback)

You are welcome to raise issues on Github to provide bug reports, issues, and feedback.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance73

Regular maintenance activity

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

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

Recently: every ~86 days

Total

10

Last Release

149d ago

Major Versions

0.1.0 → 1.0.02024-11-11

0.2.0 → 1.0.12025-02-10

1.0.1 → 2.0.02025-04-10

PHP version history (2 changes)0.0.0PHP ^8.3

2.0.0PHP ^8

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17785811?v=4)[Anthony Edmonds](/maintainers/AnthonyEdmonds)[@AnthonyEdmonds](https://github.com/AnthonyEdmonds)

---

Top Contributors

[![AnthonyEdmonds](https://avatars.githubusercontent.com/u/17785811?v=4)](https://github.com/AnthonyEdmonds "AnthonyEdmonds (33 commits)")

---

Tags

laravelloggingdatabasemonolog

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/anthonyedmonds-laravel-database-log/health.svg)

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

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k55.8M13.1k](/packages/illuminate-database)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.9M110](/packages/mongodb-laravel-mongodb)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8723.3M27](/packages/yajra-laravel-oci8)

PHPackages © 2026

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