PHPackages                             nechaienko/laravel-mongodb-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. [Database &amp; ORM](/categories/database)
4. /
5. nechaienko/laravel-mongodb-logging

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

nechaienko/laravel-mongodb-logging
==================================

Logging to Mongodb using Laravel logging

1.0.2(7y ago)52.9k3PHPPHP &gt;=7.1

Since Jan 17Pushed 7y agoCompare

[ Source](https://github.com/nechaienko/laravel-mongodb-logging)[ Packagist](https://packagist.org/packages/nechaienko/laravel-mongodb-logging)[ RSS](/packages/nechaienko-laravel-mongodb-logging/feed)WikiDiscussions master Synced today

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

About Laravel-mongodb-logging
-----------------------------

[](#about-laravel-mongodb-logging)

This package gives opportunity **logging to mongodb** with custom ***[Laravel logging](https://laravel.com/docs/5.7/logging)***

Package [jenssegers/laravel-mongodb](https://github.com/jenssegers/laravel-mongodb) is required

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

[](#installation)

```
composer require nechaienko/laravel-mongodb-logging

```

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

[](#configuration)

Add configurations to file `..\your_project\config\logging.php`

```
'mogodb-channel' => [
            'driver' => 'custom',
            'via' => \Nechaienko\MongodbLogging\LogToMongoDb::class,
            'level' => 'info',
            'connection' => 'mongodb',
            'collection' => 'logs',
        ],

```

Customization
-------------

[](#customization)

#### Additional fields

[](#additional-fields)

```
'mogodb-channel' => [
            ...
            'additional_fields' => [
                'environment' => config('app.env'),
                ...
            ],
        ],

```

#### Fields formatting

[](#fields-formatting)

You can override model from package and change fields format with ***[Laravel mutators](https://laravel.com/docs/5.7/eloquent-mutators)***

1. Create your model and override needed method

```
namespace App\Services\Logging;

use Nechaienko\MongodbLogging\MongoDbModel as ParentMongoDbModel;

class MongoDbModel extends ParentMongoDbModel
{
    public function setDatetimeAttribute($value)
    {
        ...
        $this->attributes['datetime'] = $resultValue;
    }
}

```

1. Add your model to confs

```
'mogodb-channel' => [
            ...
            'custom_model' => \App\Services\Logging\MongoDbModel::class,
        ],

```

#### Set default fields

[](#set-default-fields)

You can define fields to set by overriding constant **FIELDS\_TO\_SET**

```
namespace App\Services\Logging;

use Nechaienko\MongodbLogging\MongoDbModel as ParentMongoDbModel;

class MongoDbModel extends ParentMongoDbModel
{
    public const FIELDS_TO_SET = [
        'message',
        'level_name',
        'datetime',
        'extra',
    ];
}

```

Usage
-----

[](#usage)

```
use Illuminate\Support\Facades\Log;
...
Log::channel('mogodb-channel')->info('message');

```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity57

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

Total

2

Last Release

2668d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c01d33b72c95f9fcac5bf56334e09a2ed0e1e268f3455348e100c159eb621eb?d=identicon)[nechaienko](/maintainers/nechaienko)

---

Top Contributors

[![nechaienko](https://avatars.githubusercontent.com/u/46781086?v=4)](https://github.com/nechaienko "nechaienko (1 commits)")

---

Tags

loglaravelloggingdatabasedbmongodb

### Embed Badge

![Health badge](/badges/nechaienko-laravel-mongodb-logging/health.svg)

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

###  Alternatives

[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.

135934.5k1](/packages/danielme85-laravel-log-to-db)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[cybercog/laravel-clickhouse

ClickHouse migrations for Laravel

163166.8k](/packages/cybercog-laravel-clickhouse)[moharrum/laravel-adminer

Adminer database management tool for your Laravel application.

451.0k](/packages/moharrum-laravel-adminer)

PHPackages © 2026

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