| Package Data | |
|---|---|
| Maintainer Username: | jbravo |
| Maintainer Contact: | nerd305@gmail.com (Mark Hilton) |
| Package Create Date: | 2016-07-15 |
| Package Last Update: | 2021-04-12 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-10-23 03:04:31 |
| Package Statistics | |
|---|---|
| Total Downloads: | 127,035 |
| Monthly Downloads: | 1,731 |
| Daily Downloads: | 110 |
| Total Stars: | 40 |
| Total Watchers: | 2 |
| Total Forks: | 19 |
| Total Open Issues: | 7 |
This package will log errors into MySQL database instead storage/log/laravel.log file.
composer require markhilton/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
In your application bootstrap/app.php add:
$app->configureMonologUsing(function($monolog) use($app) {
$monolog->pushHandler(new Logger\Monolog\Handler\MysqlHandler());
});
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
Based on: