tommyready / monolog-mysql by gmgdeveloper
forked from markhilton/monolog-mysql

Laravel 5 MySQL driver for Monolog forked from markhilton/monolog-mysql
75
0
2
Package Data
Maintainer Username: gmgdeveloper
Maintainer Contact: nerd305@gmail.com (Mark Hilton)
Package Create Date: 2017-09-08
Package Last Update: 2017-09-12
Language: PHP
License: MIT
Last Refreshed: 2024-11-15 15:05:32
Package Statistics
Total Downloads: 75
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Laravel Monolog MySQL Handler.

This package will log errors into MySQL database instead storage/log/laravel.log file.

Installation

composer require gmg/monolog-mysql

Open up config/app.php and find the providers key.

'providers' => array(
    // ...
    Logger\Laravel\Provider\MonologMysqlHandlerServiceProvider::class,
);

Publish config using Laravel Artisan CLI.

php artisan vendor:publish

Migrate tables.

php artisan migrate

Application Integration

In your application bootstrap/app.php add:

$app->configureMonologUsing(function($monolog) use($app) {
    $monolog->pushHandler(new Logger\Monolog\Handler\MysqlHandler());
});

Environment configuration

If you wish to change default table name to write the log into or database connection use following definitions in your .env file

DB_LOG_TABLE=logs
DB_LOG_CONNECTION=mysql

Credits

Based on:

  • [Pedro Fornaza] (https://github.com/pedrofornaza/monolog-mysql)