Installation
Install through composer
If you wish to use MongoDb instead of mysql, you need to install and configure Laravel MongoDB .
you can run the composer require command from your terminal.
composer require gazatem/glog
I've upgraded the script and it's now suitable to use with Laraveş 5.6 Since you do not add Gazatem\Glog\Providers\GlogServiceProvider::class,
to config. Bu you need some changes on logging config.
Open config/logging.php and add following array item to configuration file:
'glog' => [
'driver' => 'monolog',
'handler' => \Gazatem\Glog\Glog::class,
],
And later do not forget to modify stack and add glog to stack. That is first item of configuration:
'stack' => [
'driver' => 'stack',
'channels' => ['single', 'glog'],
],
Open your config/app.php add following line in the providers array
Gazatem\Glog\GlogServiceProvider::class
Additionally add the listener to your app/Providers/EventServiceProvider.php:
\Gazatem\Glog\Events\MailLog::class => [
\Gazatem\Glog\Listeners\MailListener::class,
],
Add the service provider to your config/app.php file
Gazatem\Glog\Providers\GlogServiceProvider::class,
Publish the configuration file(s)
php artisan vendor:publish --provider="Gazatem\Glog\Providers\GlogServiceProvider"
Additionally add the listener to your app/Providers/EventServiceProvider.php:
\Gazatem\Glog\Events\MailLog::class => [
\Gazatem\Glog\Listeners\MailListener::class,
],
Before to run migration file, if you prefer to use mongodb, do not forget to configure mongodb.
php artisan migrate
Then in your bootstrap/app.php add / update your Monolog configiuration.
$app->configureMonologUsing(function ($monolog) {
$monolog->pushHandler(new \Gazatem\Glog\Glog());
});