PHPackages                             supersixtwo/dblog - 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. supersixtwo/dblog

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

supersixtwo/dblog
=================

Lightweight Laravel package for writing custom logs and error messages to a database.

v1.0.1(1y ago)4441MITPHPPHP &gt;=5.3.0

Since Sep 20Pushed 1y ago2 watchersCompare

[ Source](https://github.com/supersixtwo/dblog)[ Packagist](https://packagist.org/packages/supersixtwo/dblog)[ Docs](https://github.com/supersixtwo/dblog)[ RSS](/packages/supersixtwo-dblog/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

DBlog - Custom Laravel Logs Writer
==================================

[](#dblog---custom-laravel-logs-writer)

[![Latest Version on Packagist](https://camo.githubusercontent.com/95183a6cd320e1cda16145134d52c12d3f1db5977e64d33c312113d0eab47992/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737570657273697874776f2f64626c6f672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/supersixtwo/dblog)[![Total Downloads](https://camo.githubusercontent.com/63fab0b8ba4910d5df29fd38fb1d09f527cb24ebedb333434c9c6023703c75e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f737570657273697874776f2f64626c6f672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/supersixtwo/dblog)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

DBlog is a lightweight and simple [Laravel](http://www.laravel.com) Package that allows you write custom logs and error messages to a database table.

Written to mirror the [Laravel Logging](http://laravel.com/docs/master/errors#logging) conventions, `DBlog` provides 8 logging levels defined in [RFC 5424](https://tools.ietf.org/html/rfc5424) and the ability to add an optional context array to each log.

**NOTE:** This package DOES NOT integrate with the Laravel / Monolog logging system and does not capture system level events. It's purpose is to be used to capture your own custom log needs.

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

[](#installation)

Via Composer:

```
$ composer require supersixtwo/dblog
```

Then add the service provider in `config/app.php`:

```
Supersixtwo\Dblog\DBlogServiceProvider::class,
```

And the alias in `config/app.php`:

```
'DBlog'		=> Supersixtwo\Dblog\DBlogClass::class,
```

Re-run the autoload:

```
$ composer dump-autoload
```

Publish the migrations:

```
$ php artisan vendor:publish
```

Run the migrations to install the tables in the database:

```
$ php artisan migrate
```

Usage
-----

[](#usage)

### Logging Messages

[](#logging-messages)

We've provided `DBlog` with a familiar interface, mirroring Laravel's own built-in logging methods. These follow the same RFC 5424 defined logging levels including: **emergency, alert, critical, error, warning, notice, info, and debug**.

Include the `DBlog` at the top of your class or model:

```
use DBlog;
```

Use one of the 8 helper methods in your logic:

```
DBlog::emergency($msg);
DBlog::alert($msg);
DBlog::critical($msg);
DBlog::error($msg);
DBlog::warning($msg);
DBlog::notice($msg);
DBlog::info($msg);
DBlog::debug($msg);
```

### Contextual Information

[](#contextual-information)

In addition to logging text based messages, you can also an array of contextual information to the logging methods. This contextual data will converted to a `json` array and stored in separate column.

```
DBlog::info('New User Creation', ['id' => 45, 'created_by' => 'jdoe']);
```

DBlog Model and Table
---------------------

[](#dblog-model-and-table)

### Model and Table Names

[](#model-and-table-names)

To avoid collisions and naming conflicts with the DBlog Facade or other tables, the database table can be accessed using the following:

- Model Name: `DBlogModel`
- Table Name: `dblogs`

### `dblogs` Table Columns

[](#dblogs-table-columns)

ColumnTypeDefault ValueNullableCommentsidint(10) unsignedNOlevel\_idint(11)NOThe RFC 5424 log level idlevel\_descriptionvarchar(255)NOThe RFC 5424 log level descriptionmessagetextNOcontexttextYEScreated\_attimestampCURRENT\_TIMESTAMPNO### Querying the Model

[](#querying-the-model)

First, include the `DBlogModel` with the namespace:

```
use Supersixtwo\Dblog\DBlogModel;
```

Then via Query Builder:

```
$logs = DB::table('dblogs')->get();
```

or via Eloquent:

```
$logs = DBlogModel::all();
```

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

[](#change-log)

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

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

[](#contributing)

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

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Troy Peterson](http://www.supersixtwo.com)

License
-------

[](#license)

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

Acknowledgements
----------------

[](#acknowledgements)

This package is heavily inspired by the [Monolog Logging Library](https://github.com/Seldaek/monolog).

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.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 ~3278 days

Total

2

Last Release

615d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/39197b27fd1592104f549d64cf30f130ef2c62214f49cc22bc5efa6206cba5e8?d=identicon)[supersixtwo](/maintainers/supersixtwo)

---

Top Contributors

[![tepeters](https://avatars.githubusercontent.com/u/10763814?v=4)](https://github.com/tepeters "tepeters (14 commits)")[![supersixtwo](https://avatars.githubusercontent.com/u/2350660?v=4)](https://github.com/supersixtwo "supersixtwo (4 commits)")

---

Tags

laravellaravel-loggingLaravel-Databasedatabase-loggingdblogcustom-loggingsupersixtwo

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/supersixtwo-dblog/health.svg)

```
[![Health](https://phpackages.com/badges/supersixtwo-dblog/health.svg)](https://phpackages.com/packages/supersixtwo-dblog)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

86910.0M83](/packages/spatie-laravel-health)[rollbar/rollbar-laravel

Rollbar error monitoring integration for Laravel projects

14110.4M7](/packages/rollbar-rollbar-laravel)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[kitloong/laravel-app-logger

Laravel log for your application

101.2M8](/packages/kitloong-laravel-app-logger)[designmynight/laravel-log-mailer

A package to support logging via email in Laravel

1538.7k](/packages/designmynight-laravel-log-mailer)[shaffe/laravel-mail-log-channel

A package to support logging via email in Laravel

1286.2k](/packages/shaffe-laravel-mail-log-channel)

PHPackages © 2026

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