Unified Exception Logging System across Laravel Applications

1.0.2 2018-08-26 05:36 UTC

This package is not auto-updated.

Last update: 2020-03-22 13:48:16 UTC


Its an Exception Logging Library made for Laravel Application


Run the following command

$ composer require johnturingan/laravel-exception-logger

or modify your composer.json like below

"require": {
	"johnturingan/laravel-exception-logger": "*",

Then run $ composer install or $ composer update, whichever you prefer.

Laravel Installation

You need to register the package by going to config/app.php file then add it to the list of providers.

'providers' => [

or in Lumen Application


Then publish it by using this command

$ php artisan vendor:publish --provider="Snp\Logger\Providers\LaravelProvider::class"

Keep in mind that config may vary from application to application, it is a must that you check your config file config/logging.php and replace the values that is suitable to the application who will use it.

Recommended Usage


There are several ways on how to use this package but it is highly recommended that you follow implementations enumerated below:

  1. It is highly recommend that you extend your custom exception from


Then set corresponding values info it like domain, reference_id, etc..

If you extend your exception from **Snp\Logger\Exceptions\Exception** class, it will automatically log it in Graylog or in storage logs if configured in config/logging.php
  1. Another option is to use it in App\Exceptions\Handler file. Here's how to do it:
    • Extend the App\Exceptions\Handler class from Snp\Logger\Exceptions\Exception

    • In report() method, add "app_fault" property in Exception $e to determine which application throws an Error.

    • Then create an Snp\Logger\Info object and assign it to "log_info" property in Exception $e then pass the Exception to report() method.

      Below is an example:

       public function report(Exception $e)
           $e->{'app_fault'} = 'API-CMS';
           $e->{'log_info'} = (new Info())

      Using this option, you can manage all exception easily because its in single place only.


If all the properties has been filled up accordingly, below is the expected log output inside storate/logs/laravel.log

[2018-03-21 07:14:56] production.ERROR: SOAP-ERROR: Parsing WSDL: Couldn't load from ''
   "message":"An error occured",
         "gzip, deflate"