Laravel
Laravel 7.x package for logging errors
Installation
You can install the package through Composer.
Then publish the config and migration file of the package using artisan.
And adjust config file (config/errorlogger.php
) with your desired settings.
Note: By default only local environments will report errors. To modify this edit your errorlogger configuration.
ENV Configuration
Application keys are generated at https://error-logger.netlify.app/
All that is left to do is to define env configuration variable in .env
ERRORLOGGER_API_KEY
is key which authorizes your application to the API.
Next is to add the
errorlogger
driver to thelogging.php
file:
After that you have configured the ErrorLogger channel you can add it to the stack section:
Frontend
To catch frontend errors, add this include blade directive on top of the file where you want to log errors.
Testing
Now test to see if it works, you can do this in two ways.
Option 1:
Run this in your terminal:
Option 2:
Run this code in your application to see if the exception is received by ErrorLogger.
And you are good to go! Happy coding :)
Last updated