PHPackages                             adityadarma/laravel-database-logging - 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. adityadarma/laravel-database-logging

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

adityadarma/laravel-database-logging
====================================

Logging activities database for laravel

2.8.0(1mo ago)2382MITPHPPHP ^8.0

Since May 12Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/adityadarma/laravel-database-logging)[ Packagist](https://packagist.org/packages/adityadarma/laravel-database-logging)[ Docs](https://github.com/adityadarma/laravel-database-logging)[ RSS](/packages/adityadarma-laravel-database-logging/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (68)Used By (0)

Laravel Activity Logger
=======================

[](#laravel-activity-logger)

[![Tests](https://github.com/adityadarma/laravel-database-logging/workflows/Tests/badge.svg)](https://github.com/adityadarma/laravel-database-logging/actions)[![Latest Stable Version](https://camo.githubusercontent.com/b0d1e47f03021cbf25b5852f2523dd1085572dd5e15f4caaec502ecf443f00da/68747470733a2f2f706f7365722e707567782e6f72672f6164697479616461726d612f6c61726176656c2d64617461626173652d6c6f6767696e672f762f737461626c65)](https://packagist.org/packages/adityadarma/laravel-database-logging)[![License](https://camo.githubusercontent.com/44b0d7e6f23dfb347d6313301228333e8db77faf18c02b82e017aaba2cd61600/68747470733a2f2f706f7365722e707567782e6f72672f6164697479616461726d612f6c61726176656c2d64617461626173652d6c6f6767696e672f6c6963656e7365)](https://packagist.org/packages/adityadarma/laravel-database-logging)

Laravel Database Logging is a feature that allows developers to store application logs in a database, rather than the default file-based storage. This feature provides a structured and organized approach to managing application logs, making it easier to query and analyze them.

### Laravel Installation Instructions

[](#laravel-installation-instructions)

1. From your projects root folder in terminal run:

    ```
    composer require adityadarma/laravel-database-logging
    ```
2. Install config and asset to record the activities to:

    ```
    php artisan database-logging:install
    ```
3. Run the migration to add the table to record, before running please check morph key type on config to set type column:

    \*Note: Before migrate, please check config `/config/database-logging.php` type data on morp relation

    ```
    php artisan migrate
    ```

### Configuration

[](#configuration)

Laravel Database Logging can be configured in directly in `/config/database-logging.php` if you published the assets. Or you can variables to your `.env` file.

##### Environment File

[](#environment-file)

Here are the `.env` file variables available:

```
CONNECTION_LOGGING=mysql // remove if same connection
ENABLE_LOGGING=true
QUERY_LOGGING=false
DURATION_LOGGING=30
```

### Usage

[](#usage)

##### Middleware Usage

[](#middleware-usage)

Events for laravel authentication scaffolding are listened for as providers and are enabled via middleware. You can add events to your routes and controllers via the middleware:

```
capture-logging

```

Example to start recording page views using middleware in `web.php`:

```
Route::group(['middleware' => ['web', 'capture-logging']], function () {
    Route::get('/', 'WelcomeController@welcome')->name('welcome');
});
```

This middleware can be enabled/disabled in the configuration settings.

##### Trait Usage

[](#trait-usage)

Events can be recorded directly by using the trait. When using the trait you can customize the event description.

To use the trait:

1. Include the call in the head of your class file:

    ```
    use \AdityaDarma\LaravelDatabaseLogging\Traits\DatabaseLoggable;
    ```
2. Include the trait call in the opening of your class:

    ```
    use DatabaseLoggable;
    ```

### Routes

[](#routes)

##### Laravel Activity Dashboard Routes

[](#laravel-activity-dashboard-routes)

Set route access from file config `database-logging.php`

- `/database-logging`

### Purge

[](#purge)

##### Remove data logger

[](#remove-data-logger)

Set limit days data log from file config `database-logging.php` then run the command

- `database-logging:purge`

License
-------

[](#license)

This Package is licensed under the MIT license. Enjoy!

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance95

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

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

Recently: every ~80 days

Total

67

Last Release

54d ago

Major Versions

1.3.2 → 2.3.22025-03-01

1.3.4 → 2.3.42025-03-14

1.3.9 → 2.3.82025-03-20

1.5.3 → 2.5.02025-04-07

1.6.1 → 2.6.02025-05-01

PHP version history (2 changes)1.0.0PHP ^7.4|^8.0

2.0.0PHP ^8.0

### Community

Maintainers

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

---

Top Contributors

[![adityadarma](https://avatars.githubusercontent.com/u/37822288?v=4)](https://github.com/adityadarma "adityadarma (95 commits)")

---

Tags

laravellaravel-loggingdatabase-logging

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/adityadarma-laravel-database-logging/health.svg)

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

###  Alternatives

[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14642.7k1](/packages/guanguans-laravel-exception-notify)[tobiasdierich/gauge

An easy to use application performance monitor.

14413.1k](/packages/tobiasdierich-gauge)[designmynight/laravel-log-mailer

A package to support logging via email in Laravel

1538.7k](/packages/designmynight-laravel-log-mailer)

PHPackages © 2026

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