Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simon28082/logger
Mongodb log extension based on laravel logs
https://github.com/simon28082/logger
laravel log logger monolog monolog-handler
Last synced: 3 days ago
JSON representation
Mongodb log extension based on laravel logs
- Host: GitHub
- URL: https://github.com/simon28082/logger
- Owner: simon28082
- License: mit
- Created: 2019-01-24T13:23:09.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-06T14:56:54.000Z (over 5 years ago)
- Last Synced: 2024-04-14T05:12:07.623Z (7 months ago)
- Topics: laravel, log, logger, monolog, monolog-handler
- Language: PHP
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Logger
[![Latest Stable Version](https://poser.pugx.org/crcms/logger/v/stable)](https://packagist.org/packages/crcms/logger)
[![License](https://poser.pugx.org/crcms/logger/license)](https://packagist.org/packages/crcms/logger)
[![StyleCI](https://github.styleci.io/repos/167371373/shield?branch=master)](https://github.styleci.io/repos/167371373)Mongodb log extension based on laravel logs
## Install
```
composer require crcms/logger
```## Config
Modify the following two configuration files
`config/logging.php`
```php
use CrCms\Log\MongoDBLogger;'channels' => [
'mongo' => [
'driver' => 'custom',
// If it is empty, the default app.env
//'name' => env('APP_ENV', 'production'),
'via' => MongoDBLogger::class,
'level' => 'debug',
'database' => [
'driver' => 'mongodb',
// If it is empty, the default database will be selected.
'database' => 'logger',
'collection' => 'logger',
],
],
]
````config/database.php`
```php
'connections' => [
'mongodb' => [
'driver' => 'mongodb',
'host' => env('DB_MONGO_HOST', 'localhost'),
'port' => env('DB_MONGO_PORT', 27017),
'database' => env('DB_MONGO_DATABASE'),
'username' => env('DB_MONGO_USERNAME'),
'password' => env('DB_MONGO_PASSWORD'),
'options' => [
'database' => env('DB_MONGO_AUTH_DATABASE', 'admin')
]
],
]
```