2017 © Pedro Peláez
 

library laravel-exception-monitor

Little Laravel package to notify you about exceptions in your application.

image

adriandmitroca/laravel-exception-monitor

Little Laravel package to notify you about exceptions in your application.

  • Sunday, March 27, 2016
  • by adriandmitroca
  • Repository
  • 1 Watchers
  • 7 Stars
  • 170 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Laravel Exception Monitor

Latest Version on Packagist Software License Build Status SensioLabsInsight Quality Score Total Downloads, (*1)

This package notifies you when exceptions are thrown on some of your production application. It's like lite and free version of Bugsnag for small projects for which the use of this amazing SaaS tool would be simply overkill., (*2)

Slack Preview, (*3)

Installation

``` bash composer require adriandmitroca/laravel-exception-monitor, (*4)


Next, you need to register Service Provider in `config/app.php` ```php $providers = [ ... Adriandmitroca\LaravelExceptionMonitor\ExceptionMonitorServiceProvider::class, ... ];

and then publish configuration files, (*5)

php artisan vendor:publish --provider="Adriandmitroca\LaravelExceptionMonitor\ExceptionMonitorServiceProvider"

You also have to make sure if you have makzn/slack package installed and configured properly for Slack notifications., (*6)

Configuration

Config File is pretty self-explanatory., (*7)

<?php

return [
    /*
     |--------------------------------------------------------------------------
     | Enabled sender drivers
     |--------------------------------------------------------------------------
     |
     | Send a notification about exception in your application to supported channels.
     |
     | Supported: "mail", "slack". You can use multiple drivers.
     |
     */
    'drivers'      => [ 'mail', 'slack' ],

    /*
     |--------------------------------------------------------------------------
     | Enabled application environments
     |--------------------------------------------------------------------------
     |
     | Set environments that should generate notifications.
     |
     */
    'environments' => [ 'production' ],

    /*
     |--------------------------------------------------------------------------
     | Mail Configuration
     |--------------------------------------------------------------------------
     |
     | It uses your app default Mail driver. You shouldn't probably touch the view
     | property unless you know what you're doing.
     |
     */
    'mail'         => [
        'from' => 'sender@example.com',
        'to'   => 'recipient@example.com',
        'view' => 'mails/exception-monitor'
    ],

    /*
     * Uses maknz\slack package.
     */
    'slack'        => [
        'channel'  => '#bugtracker',
        'username' => 'Exception Monitor',
        'icon'     => ':robot_face:',
    ],
];

Usage

To start catching exceptions you have 2 options out there., (*8)

First option: Extend from Exception Handler provided by package (app/Exceptions/Handler.php):, (*9)

use Adriandmitroca\LaravelExceptionMonitor\MonitorExceptionHandler;
...
class Handler extends MonitorExceptionHandler

Second option: Make your report method in app/Exceptions/Handler.php to look like this:, (*10)

public function report(Exception $e)
{
    foreach ($this->dontReport as $type) {
        if ($e instanceof $type) {
            return parent::report($e);
        }
    }

    if (app()->bound('exception-monitor')) {
        app('exception-monitor')->notifyException($e);
    }

    parent::report($e);
}

Changelog

Please see CHANGELOG for more information., (*11)

Tests

bash composer test, (*12)

Contributing

Please see CONTRIBUTING for more details., (*13)

License

This library is licensed under the MIT license. Please see License file for more information., (*14)

The Versions

27/03 2016

dev-master

9999999-dev

Little Laravel package to notify you about exceptions in your application.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Dmitroca

laravel adriandmitroca exception monitor

27/03 2016

1.0.0

1.0.0.0

Little Laravel package to notify you about exceptions in your application.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Dmitroca

laravel adriandmitroca exception monitor

21/03 2016

0.1.0

0.1.0.0

Little Laravel package to notify you about exceptions in your application.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Dmitroca

laravel adriandmitroca exception monitor