Laravel 5 package for logging errors to your e-mail(s), database or both!
You can install the package through Composer.
composer require yaro/log-envelope
You must install this service provider. Make this the very first provider in list.
// config/app.php
'providers' => [
// make this very first provider
// so fatal exceptions can be catchable by envelope
Yaro\LogEnvelope\ServiceProvider::class,
//...
//...
];
Then publish the config and migration file of the package using artisan.
php artisan vendor:publish --provider="Yaro\LogEnvelope\ServiceProvider"
And put receiver email into the configuration, this can also be an array to send to more users:
'email_to' => '',
--OR--
'email_to' => [
'[email protected]',
'[email protected]'
],
You can also choose to log your errors to your database, or log to both ways, to do this change the config option to your likings:
/*
* Decide where to log to
*
* Options: mail, database or both
*/
'log_to' => 'database',
If you don't want the messages (e-mails) to be send immediately, change this to true so they get queued:
/*
* Decide wether it should queue
*
*/
'should_queue' => false,
Add to your Exception Handler's (/app/Exceptions/Handler.php
by default) report
method these line:
//...
public function report(Exception $e)
{
$res = parent::report($e);
\LogEnvelope::send($e);
//...
return $res;
}
//...
- Add slack support
Something like this with other info for debugging.
The MIT License (MIT). Please see LICENSE for more information.