All Projects → jeremykenedy → Laravel Exception Notifier

jeremykenedy / Laravel Exception Notifier

Licence: mit
Laravel Exception Notifier will send an email of the error along with the stack trace to the chosen recipients. This Package includes all necessary traits, views, configs, and Mailers for email notifications upon your applications exceptions. You can customize who send to, cc to, bcc to, enable/disable, and custom subject or default subject based on environment. Built for Laravel 5.2, 5.3, 5.4, 5.5+. Get the errors and fix them before the client even reports them, that's why this exists! For Laravel 5, 6, and 7

Projects that are alternatives of or similar to Laravel Exception Notifier

Traceback with variables
Adds variables to python traceback. Simple, lightweight, controllable. Debug reasons of exceptions by logging or pretty printing colorful variable contexts for each frame in a stacktrace, showing every value. Dump locals environments after errors to console, files, and loggers. Works in Jupyter and IPython. Install with pip or conda.
Stars: ✭ 509 (+441.49%)
Mutual labels:  exceptions
Rollbar Android
Rollbar for Android
Stars: ✭ 41 (-56.38%)
Mutual labels:  exceptions
Backtrace
Makes Python tracebacks human friendly
Stars: ✭ 80 (-14.89%)
Mutual labels:  exceptions
Bugsnag Laravel
Bugsnag notifier for the Laravel PHP framework. Monitor and report Laravel errors.
Stars: ✭ 746 (+693.62%)
Mutual labels:  exceptions
Bugsnag Android
Bugsnag crash monitoring and reporting tool for Android apps
Stars: ✭ 990 (+953.19%)
Mutual labels:  exceptions
Bugsnag Node
[DEPRECATED] Please upgrade to our Universal JS notifier "@bugsnag/js" • https://github.com/bugsnag/bugsnag-js
Stars: ✭ 48 (-48.94%)
Mutual labels:  exceptions
Rollbar Gem
Exception tracking and logging from Ruby to Rollbar
Stars: ✭ 414 (+340.43%)
Mutual labels:  exceptions
Vue Raven
vue-raven automatically reports uncaught JavaScript exceptions triggered from vue component
Stars: ✭ 91 (-3.19%)
Mutual labels:  exceptions
Friendly Exception
An interface for an exception to be friendly
Stars: ✭ 41 (-56.38%)
Mutual labels:  exceptions
Vos backend
vangav open source - backend; a backend generator (generates more than 90% of the code needed for big scale backend services)
Stars: ✭ 71 (-24.47%)
Mutual labels:  exceptions
Sosl
StackOverflow Search Library
Stars: ✭ 10 (-89.36%)
Mutual labels:  exceptions
Restfulsense
A RESTFul operations client that serializes responses and throws meaningful exceptions for >= 400 status codes.
Stars: ✭ 28 (-70.21%)
Mutual labels:  exceptions
Noexception
Java library for handling exceptions in concise, unified, and architecturally clean way.
Stars: ✭ 56 (-40.43%)
Mutual labels:  exceptions
Bugsnag Js
Javascript error handling tool for Bugsnag. Monitor and report JavaScript bugs & errors.
Stars: ✭ 625 (+564.89%)
Mutual labels:  exceptions
Larabug
Laravel error reporting tool
Stars: ✭ 84 (-10.64%)
Mutual labels:  exceptions
Bugsnag Php
Bugsnag error monitoring and crash reporting tool for PHP apps
Stars: ✭ 475 (+405.32%)
Mutual labels:  exceptions
Bugsnag Android Ndk
DEPRECATED - this project now lives at bugsnag/bugsnag-android
Stars: ✭ 42 (-55.32%)
Mutual labels:  exceptions
Coderr.server
Replace logfiles with Coderr to correct bugs faster and more efficiently.
Stars: ✭ 92 (-2.13%)
Mutual labels:  exceptions
React Guard
🦄 React Guard automagically catches exceptions from React components, extracts useful debug information and prevents White Screen of Death 👻
Stars: ✭ 89 (-5.32%)
Mutual labels:  exceptions
Bugsnag Python
Official bugsnag error monitoring and error reporting for django, flask, tornado and other python apps.
Stars: ✭ 69 (-26.6%)
Mutual labels:  exceptions

Laravel Exception Notifier | A Laravel 5, 6, 7, and 8 Exceptions Email Notification Package

Total Downloads Latest Stable Version Build Status StyleCI Scrutinizer Code Quality Code Intelligence Status MadeWithLaravel.com shield License: MIT

Table of contents:

About

Laravel exception notifier will send an email of the error along with the stack trace to the chosen recipients. This Package includes all necessary traits, views, configs, and Mailers for email notifications upon your applications exceptions. You can customize who send to, cc to, bcc to, enable/disable, and custom subject or default subject based on environment. Built for Laravel 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 6, 7, and 8+.

Get the errors and fix them before the client even reports them, that's why this exists!

Requirements

Installation Instructions

  1. From your projects root folder in terminal run:

    Laravel 7+ use:

        composer require jeremykenedy/laravel-exception-notifier
    

    Laravel 6 and below use:

        composer require jeremykenedy/laravel-exception-notifier:1.2.0
    
  2. Register the package

  • Laravel 5.5 and up Uses package auto discovery feature, no need to edit the config/app.php file.

  • Laravel 5.4 and below Register the package with laravel in config/app.php under providers with the following:

       jeremykenedy\laravelexceptionnotifier\LaravelExceptionNotifier::class,
    
  1. Publish the packages view, mailer, and config files by running the following from your projects root folder:

        php artisan vendor:publish --tag=laravelexceptionnotifier
    
  2. In App\Exceptions\Handler.php include the additional following classes in the head:

    use App\Mail\ExceptionOccured;
    use Illuminate\Support\Facades\Log;
    use Mail;
    use Symfony\Component\Debug\Exception\FlattenException;
    use Symfony\Component\Debug\ExceptionHandler as SymfonyExceptionHandler;
  1. In App\Exceptions\Handler.php replace the report() method with:

    /**
     * Report or log an exception.
     *
     * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
     *
     * @param \Throwable $exception
     *
     * @return void
     */
    public function report(Throwable $exception)
    {
        $enableEmailExceptions = config('exceptions.emailExceptionEnabled');
    
        if ($enableEmailExceptions === '') {
            $enableEmailExceptions = config('exceptions.emailExceptionEnabledDefault');
        }
    
        if ($enableEmailExceptions && $this->shouldReport($exception)) {
            $this->sendEmail($exception);
        }
    
        parent::report($exception);
    }
    
  2. In App\Exceptions\Handler.php add the method sendEmail():

    /**
     * Sends an email upon exception.
     *
     * @param \Throwable $exception
     *
     * @return void
     */
    public function sendEmail(Throwable $exception)
    {
        try {
            $e = FlattenException::create($exception);
            $handler = new SymfonyExceptionHandler();
            $html = $handler->getHtml($e);
    
            Mail::send(new ExceptionOccured($html));
        } catch (Throwable $exception) {
            Log::error($exception);
        }
    }
    
  3. Configure your email settings in the .env file.

  4. Add the following (optional) settings to your .env file and enter your settings:

    • Note: the defaults for these are located in config/exception.php
        EMAIL_EXCEPTION_ENABLED=false
        EMAIL_EXCEPTION_FROM="${MAIL_FROM_ADDRESS}"
        EMAIL_EXCEPTION_TO='[email protected], [email protected]'
        EMAIL_EXCEPTION_CC=''
        EMAIL_EXCEPTION_BCC=''
        EMAIL_EXCEPTION_SUBJECT=''
    

Screenshots

Email Notification

File Tree

└── laravel-exception-notifier
    ├── .gitignore
    ├── LICENSE
    ├── composer.json
    ├── readme.md
    └── src
        ├── .env.example
        ├── App
        │   ├── Mail
        │   │   └── ExceptionOccured.php
        │   └── Traits
        │       └── ExceptionNotificationHandlerTrait.php
        ├── LaravelExceptionNotifier.php
        ├── config
        │   └── exceptions.php
        └── resources
            └── views
                └── emails
                    └── exception.blade.php
  • Tree command can be installed using brew: brew install tree
  • File tree generated using command tree -a -I '.git|node_modules|vendor|storage|tests'

License

Laravel-Exception-Notifier | A Laravel Exceptions Email Notification Package is open-sourced software licensed under the MIT license

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].