A Log Handler for Monolog and Laravel PHP Framework
HTML PHP CSS
Clone or download
Latest commit 6d5c503 Feb 19, 2018
Permalink
Failed to load latest commit information.
src
tests
.DS_Store
.gitignore alpha release - init Feb 13, 2016
README.md
composer.json
phpunit.xml Test file includes and missing config added Jul 18, 2016

README.md

A Log Handler for Monolog and Laravel PHP Framework

Complete documentation can be found at Wiki

Installation

Add the following to your composer.json and run composer update

{
    "require": {
        "gazatem/glog": "dev-master"
    }
}

Don't forget to dump composer autoload

composer dump-autoload

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,
        ],

Then in your bootstrap/app.php add / update your Monolog configuration.

$app->configureMonologUsing(function ($monolog) {
    $monolog->pushHandler(new \Gazatem\Glog\Glog());
});

Run following command to publish migration and configuration

 php artisan vendor:publish --provider="Gazatem\Glog\GlogServiceProvider"

To create database tables, run migration:

 php artisan migrate

Thats all now start to log the events.

Open config/glog.php file and update the settings.

USAGE

Do not fotget to include Log to your class

use Log;

And add log entry

Log::info('user.register', ['message' => 'User Registration Controller', 'id' => 23, 'name' => 'John Doe', 'email' => 'john@example.com']);

Links

gazatem.com