PHPackages                             goszowski/laravel-database-log-channel - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. goszowski/laravel-database-log-channel

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

goszowski/laravel-database-log-channel
======================================

Laravel database log channel

v2.0.0(4y ago)152.8k2MITPHPPHP ^7.0|^7.4|^8.0

Since Nov 17Pushed 4y ago2 watchersCompare

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

READMEChangelog (9)Dependencies (12)Versions (10)Used By (0)

Laravel database log channel
============================

[](#laravel-database-log-channel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/67bf18e528708a8f7103289526c756d4249f8f43352f11d93a418bf8a6e913ba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f676f737a6f77736b692f6c61726176656c2d64617461626173652d6c6f672d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/goszowski/laravel-database-log-channel)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/e3f16ba04a1693b69903aeb6d958e13b6ce195f85a0b6ea86163f433126eeddd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f676f737a6f77736b692f6c61726176656c2d64617461626173652d6c6f672d6368616e6e656c2f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/goszowski/laravel-database-log-channel/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/90af5d2a4653b426d9b90c686c3119578873eda4ed3e63fc4d3a78d45a46b27e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f676f737a6f77736b692f6c61726176656c2d64617461626173652d6c6f672d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/goszowski/laravel-database-log-channel)

The package provides the ability to write logs into the database synchronously or asynchronously, along with other logging channels.

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

[](#installation)

You can install the package via composer:

```
composer require goszowski/laravel-database-log-channel
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="database-log-channel-migrations"
php artisan migrate
```

Configure logging.php:

```
return [
    'channels' => [
        'stack' => [
            'driver' => 'stack',
            'channels' => ['daily', 'database'], // Add "database" channel
            'ignore_exceptions' => false,
        ],

        // ...
        'database' => [
            'driver' => 'monolog',
            'handler' => Goszowski\DatabaseLogChannel\Logging\DatabaseLogHandler::class,
            'via' => Goszowski\DatabaseLogChannel\Logging\DatabaseLogger::class,

            'alternative-log-channel' => 'daily', // Use an alternate channel when it is not possible to write to the database
            'connection' => null, // Use default connection
            'table' => 'logs',
            'async' => true, // If true, will be sent to the queue
            'queue' => 'default', // Define a queue for asynchronous logging
            'level' => 'error',
        ],

    ],
];
```

Usage
-----

[](#usage)

```
use Log;

Log::error('My error message');
```

Data Pruning
------------

[](#data-pruning)

Without pruning, the logs table can accumulate records very quickly. To mitigate this, you should schedule the database-logs:prune Artisan command to run daily:

```
$schedule->command('database-logs:prune')->daily();
```

By default, all entries older than 24 hours will be pruned. You may use the hours option when calling the command to determine how long to retain Logs data. For example, the following command will delete all records created over 48 hours ago:

```
$schedule->command('database-logs:prune --hours=48')->daily();
```

Changelog
---------

[](#changelog)

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

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [goszowski](https://github.com/goszowski)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 95.5% 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 ~4 days

Total

9

Last Release

1654d ago

Major Versions

v1.1.6 → v2.0.02021-12-21

PHP version history (4 changes)v1.0.0PHP ^8.0

v1.1.1PHP ^7.2|^8.0

v1.1.4PHP ^7.0|^8.0

v1.1.5PHP ^7.0|^7.4|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10208931?v=4)[Jarosław Goszowski](/maintainers/goszowski)[@goszowski](https://github.com/goszowski)

---

Top Contributors

[![goszowski](https://avatars.githubusercontent.com/u/10208931?v=4)](https://github.com/goszowski "goszowski (21 commits)")[![ovillafuerte94](https://avatars.githubusercontent.com/u/15527080?v=4)](https://github.com/ovillafuerte94 "ovillafuerte94 (1 commits)")

---

Tags

laravelgoszowskilaravel-database-log-channel

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M164](/packages/spatie-laravel-health)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M99](/packages/dedoc-scramble)[spatie/laravel-passkeys

Use passkeys in your Laravel app

471890.7k38](/packages/spatie-laravel-passkeys)[keepsuit/laravel-opentelemetry

OpenTelemetry integration for laravel

167558.4k1](/packages/keepsuit-laravel-opentelemetry)

PHPackages © 2026

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