Skip to content

m2quared/LogEnvelope

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Log Envelope

Laravel 5 package for logging errors to your e-mail(s), database or both!

Installation

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; 
}
//...

TODO

  • Add slack support

Results

Something like this with other info for debugging. results

License

The MIT License (MIT). Please see LICENSE for more information.

About

Laravel 5.* package for mailing errors.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 79.4%
  • HTML 20.6%