New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

gmg/monolog-mysql

Laravel 5 MySQL driver for Monolog forked from markhilton/monolog-mysql
77
Install
composer require gmg/monolog-mysql
Latest Version:0.2.0
PHP:>=5.5.9
License:MIT
Last Updated:Sep 12, 2017
Links: GitHub  ·  Packagist
Maintainer: gmgdeveloper

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:

Related Packages

pedrofornaza/monolog-mysql

Laravel 5 MySQL driver for Monolog

3,326 2
lichv/monolog-mysql

Laravel 5 MySQL driver for Monolog

60 1
itelmenko/laravel-mysql-logger

Laravel MySQL driver for Monolog

158,082 21
ebethus/laravel-mysql-log-driver

Laravel 10+ MySQL driver for Monolog

4,015 0
teepluss/monosql

Laravel 4 MySQL driver for Monolog

3,355 4

Version History

Version Released PHP License
0.2.0 >=5.5.9 MIT
0.1.9 >=5.5.9 MIT
0.1.8 >=5.5.9 MIT
0.1.7 >=5.5.9 MIT
0.1.6 >=5.5.9 MIT