PHPackages                             llewellyn-kevin/raygun-logger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. llewellyn-kevin/raygun-logger

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

llewellyn-kevin/raygun-logger
=============================

Laravel package for logging errors to \[Raygun\](https://raygun.com/)

v0.1.0(2y ago)03261[1 PRs](https://github.com/llewellyn-kevin/raygun-logger/pulls)MITPHPPHP ^8.0

Since Dec 9Pushed 2y ago1 watchersCompare

[ Source](https://github.com/llewellyn-kevin/raygun-logger)[ Packagist](https://packagist.org/packages/llewellyn-kevin/raygun-logger)[ Docs](https://github.com/llewellyn-kevin/raygun-logger)[ RSS](/packages/llewellyn-kevin-raygun-logger/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (6)Versions (4)Used By (0)

Laravel package for logging errors to Raygun
============================================

[](#laravel-package-for-logging-errors-to-raygun)

[![Latest Version on Packagist](https://camo.githubusercontent.com/168b403aae11012417e9a16fb97c43a613601e7eef53d10353c4eb59b5e87b35/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6c6577656c6c796e2d6b6576696e2f72617967756e2d6c6f676765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/llewellyn-kevin/raygun-logger)[![Total Downloads](https://camo.githubusercontent.com/bf68bf4c4928a7e1c7b8118566807af93feec0f00ff19104fa2ffd76ab2d067d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6c6577656c6c796e2d6b6576696e2f72617967756e2d6c6f676765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/llewellyn-kevin/raygun-logger)[![GitHub Actions](https://github.com/llewellyn-kevin/raygun-logger/actions/workflows/main.yml/badge.svg)](https://github.com/llewellyn-kevin/raygun-logger/actions/workflows/main.yml/badge.svg)

This package serves as a wrapper around [Raygun4php](https://github.com/MindscapeHQ/raygun4php) to make it quick and easy to get your Laravel project logging to [Raygun](https://raygun.com/).

> **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
------------

[](#installation)

You can install the package via composer:

```
composer require llewellyn-kevin/raygun-logger
```

In your application's `config/logging.php`, add the raygun channel config and add it to the stack config:

```
[
    'channel' => [
        'stack' => [
            'driver' => 'stack',
            'channels' => ['daily', 'raygun'],
            // ...
        ],

        // ...

        'raygun' => [
            'driver' => 'raygun',
        ],
    ],
]
```

Update your `.env` with the Raygun url and key you want to use:

```
RAYGUN_URI=https://api.raygun.com
RAYGUN_KEY=[[project key here]]

```

You can test your install with a console command:

```
php artisan ragun:test
```

Or with a custom error message:

```
php artisan ragun:test "The fox already jumped over the dog."
```

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
-----

[](#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:

```
RaygunLogger::handle(new Exception('The fox already jumped over the dog.'));
```

You can add metadata to these requests in an associative array as well:

```
RaygunLogger::handle(new Exception('The fox already jumped over the dog.'), [
    'foxname' => 'Tod',
    'dogname' => 'Copper',
]);
```

> **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

[](#filtering)

You may not want every error to show up in Raygun. There are two ways to suppress an error:

1. 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:

```
php artisan vendor:publish --tag=config
```

2. 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:

```
RaygunLogger::level(Exception::class, LogLevel::CRITICAL);
```

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
-------

[](#testing)

This package uses [Pest](https://pestphp.com/) for it's tests. For simplicity, there is a composer script to run the whole suite:

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [All Contributors](../../contributors)
- This package is massively inspired by the work done over at [LaraBug](https://www.larabug.com/). 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
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~257 days

Total

2

Last Release

1045d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e596ceb79ca41f3203f21722a8084298ad387afc14a9d9cdc2a115274a94e947?d=identicon)[llewellyn-kevin](/maintainers/llewellyn-kevin)

---

Top Contributors

[![thechrise](https://avatars.githubusercontent.com/u/15894470?v=4)](https://github.com/thechrise "thechrise (2 commits)")

---

Tags

llewellyn-kevinraygun-logger

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/llewellyn-kevin-raygun-logger/health.svg)

```
[![Health](https://phpackages.com/badges/llewellyn-kevin-raygun-logger/health.svg)](https://phpackages.com/packages/llewellyn-kevin-raygun-logger)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M164](/packages/spatie-laravel-health)[illuminate/log

The Illuminate Log package.

6225.3M621](/packages/illuminate-log)[spatie/laravel-flare

Send Laravel errors to Flare

111.4M7](/packages/spatie-laravel-flare)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
