Download the PHP package llewellyn-kevin/raygun-logger without Composer
On this page you can find all versions of the php package llewellyn-kevin/raygun-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download llewellyn-kevin/raygun-logger
More information about llewellyn-kevin/raygun-logger
Files in llewellyn-kevin/raygun-logger
Package raygun-logger
Short Description Laravel package for logging errors to [Raygun](https://raygun.com/)
License MIT
Homepage https://github.com/llewellyn-kevin/raygun-logger
Informations about the package raygun-logger
Laravel package for logging errors to Raygun
This package serves as a wrapper around Raygun4php to make it quick and easy to get your Laravel project logging to Raygun.
Warning This package is being developed alongside and being used with production applications. But it is not tagged for with version 1.0 because we can only validate those particular use cases. We will want to catch any edge cases and finalize every base use case before encouraging users to use this in critical projects.
Installation
You can install the package via composer:
In your application's config/logging.php
, add the raygun channel config and add it to the stack config:
Update your .env
with the Raygun url and key you want to use:
You can test your install with a console command:
Or with a custom error message:
This will check for environment variables, report on any missing, and send an exception with default or custom text to Raygun so you can check to make sure it shows up.
Usage
Errors should be automatically sent to raygun via the stack. But if you need to manually send an exception to Raygun for any reason you can do that with the RaygunLogger
facade:
You can add metadata to these requests in an associative array as well:
Note This is the main method of the entire package. So it enforces all core logic. This means Exception types that have been blacklisted or do not meet the level requirement will still be suppressed and NOT be sent to Raygun.
Filtering
You may not want every error to show up in Raygun. There are two ways to suppress an error:
- Blacklist the exception type
In the raygun-logger
config, you will find a parameter called blacklist. Any exceptions added to this array will not be reported to Raygun. To append to this list, you will first have to publish the config:
- Setting error levels
You may wish to specify the log levels for various exceptions in your application. You can register these levels in the RaygunLogger
facade:
Then you may update the raygun-logger
config with the base level you wish to report on. Only exceptions with the specified level or higher will be sent to Raygun.
Testing
This package uses Pest for it's tests. For simplicity, there is a composer script to run the whole suite:
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- All Contributors
- This package is massively inspired by the work done over at LaraBug. The goal was to have a LaraBug like experience for setting up Raygun. They have an amazing product and much of their code is used as the foundation for this package. If you don't need Raygun, you may give that a shot as a free alternative.
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.