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

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

ofuenzalida/laravel-mongodb-log
===============================

Mongodb Logging for Laravel

024PHP

Since Apr 9Pushed 7y ago1 watchersCompare

[ Source](https://github.com/OctavioFuenzalida/laravel-mongodb-log)[ Packagist](https://packagist.org/packages/ofuenzalida/laravel-mongodb-log)[ RSS](/packages/ofuenzalida-laravel-mongodb-log/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

laravel-mongodb-log
===================

[](#laravel-mongodb-log)

Mongodb Logging-Channel For Laravel Framework

This package is developed as a mongodb logging-channel for Laravel 5.8 and above.

### Installation

[](#installation)

You could use Composer to install the package and all needed dependencies.

```
composer require ofuenzalida/laravel-mongodb-log

```

### Configuration

[](#configuration)

Updating Database Configuration file

You should update your config/database.php file to add a mongodb connection.

```
'mongodb' => [
            'driver'   => 'mongodb',
            'host'     => env('MONGODB_HOST', 'localhost'),
            'port'     => env('MONGODB_PORT', 27017),
            'database' => env('MONGODB_DATABASE', 'logs'),
            ],

```

And also update your config/logging.php to add your custom log-channel.

```
'channels' => [
    'custom' => [
        'driver' => 'custom',
        'via' => Ofuenzalida\LaravelMongodbLog\LogHandler::class,
    ],
],

```

There is a config file to publish which you can use to set database connection and a collection name for your mongodb logs. First publish the config file:

```
php artisan vendor:publish --provider="Ofuenzalida\LaravelMongodbLog\LogServiceProvider" --tag="config"

```

Then updating the config file with your desired settings:

```
