PHPackages                             jenssegers/raven - 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. jenssegers/raven

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

jenssegers/raven
================

Sentry (Raven) error monitoring integration for Laravel projects

v1.11.0(9y ago)90197.2k↑455.6%11[5 issues](https://github.com/jenssegers/laravel-raven/issues)[1 PRs](https://github.com/jenssegers/laravel-raven/pulls)1MITPHPPHP &gt;=5.4

Since May 1Pushed 8y ago2 watchersCompare

[ Source](https://github.com/jenssegers/laravel-raven)[ Packagist](https://packagist.org/packages/jenssegers/raven)[ Docs](https://github.com/jenssegers/laravel-raven)[ RSS](/packages/jenssegers-raven/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (6)Versions (25)Used By (1)

Laravel Raven
=============

[](#laravel-raven)

[![Build Status](https://camo.githubusercontent.com/4a0b469ceff094bd89fba60cadb331c8505912cc0807dc26c5ae3ead2c0ab477/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f6a656e737365676572732f6c61726176656c2d726176656e2e737667)](https://travis-ci.org/jenssegers/laravel-raven) [![Coverage Status](https://camo.githubusercontent.com/5b2bf315033c313228191a3e10d4bb1dbc23426f3ad97a131371b84439354a47/687474703a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6a656e737365676572732f6c61726176656c2d726176656e2e737667)](https://coveralls.io/r/jenssegers/laravel-raven)

Sentry (Raven) error monitoring integration for Laravel projects. This library adds a listener to Laravel's logging component. Laravel's auth and session information will be sent in to Sentry's user context, as well as some other helpful tags such as 'environment', 'server', 'php\_version' and 'ip'.

[![rollbar](https://camo.githubusercontent.com/644c86a1dbc1367f2efe0776654db03949cf06015a74690c09af993163ade50b/68747470733a2f2f6d656469612e67657473656e7472792e636f6d2f5f7374617469632f32373963313836363765363333653938653963623164636635303462633630662f67657473656e7472792f646973742f73747265616d2e676966)](https://camo.githubusercontent.com/644c86a1dbc1367f2efe0776654db03949cf06015a74690c09af993163ade50b/68747470733a2f2f6d656469612e67657473656e7472792e636f6d2f5f7374617469632f32373963313836363765363333653938653963623164636635303462633630662f67657473656e7472792f646973742f73747265616d2e676966)

Installation
------------

[](#installation)

Install using composer:

```
composer require jenssegers/raven

```

Add the service provider in `app/config/app.php`:

```
Jenssegers\Raven\RavenServiceProvider::class,
```

If you only want to enable Sentry reporting for certain environments you can conditionally load the service provider in your `AppServiceProvider`:

```
if ($this->app->environment('production')) {
    $this->app->register(Jenssegers\Raven\RavenServiceProvider::class);
}
```

Optional: register the Raven alias:

```
'Raven'           => Jenssegers\Raven\Facades\Raven::class,
```

Configuration
-------------

[](#configuration)

This package supports configuration through environment variables and/or the services configuration file located in `app/config/services.php`:

```
'raven' => [
    'dsn'   => env('RAVEN_DSN'),
    'level' => env('LOG_LEVEL'),
],
```

The level variable defines the minimum log level at which log messages are sent to Sentry. For development you could set this either to `debug` to send all log messages, or to `none` to sent no messages at all. For production you could set this to `error` so that all info and debug messages are ignored.

For more information about the possible configuration variables, check

Usage in Laravel
----------------

[](#usage-in-laravel)

In Laravel, the service provider will automatically hook into Laravel's logger and send all messages matching the log level to Sentry.

If you want to send exceptions to Sentry, simply use the `Log` facade:

```
try {
	something();
} catch (\Exception $e) {
	Log::error($e);
}
```

For logging messages or exceptions, you can any of these methods: `debug`, `notice`, `warning`, `error`, `critical`, `alert` or `emergency`.

```
Log::debug('Here is some debug information');
```

### Alternative usage

[](#alternative-usage)

If you prefer dependency injection rather than calling the `Log` facade, you can typehint the `Jenssegers\Raven\RavenHandler` class in your controller methods:

```
use Jenssegers\Raven\RavenHandler as Raven;

...

public function index(Request $request, Raven $raven)
{
	Raven::info('Request received!');
}
```

### Context informaton

[](#context-informaton)

The included context builder will automatically collect information about the current logged in user and the session information. If can pass additional user context information like this:

```
Log::error('Something went wrong', [
    'user' => ['name' => 'John Doe', 'email' => 'john@doe.com']
]);
```

Or pass additional tags:

```
Log::info('Task completed', [
    'tags' => ['state' => 1234]
]);
```

Or pass some extra information:

```
Log::warning('Something went wrong', [
    'download_size' => 3432425235
]);
```

Usage in Lumen
--------------

[](#usage-in-lumen)

Because Lumen uses a different way of handling logging, the service provider is unable to intercept actual exceptions. Instead you can use the included `Raven` facade. First add the following to your `bootstrap/app.php`:

```
$app->register(Jenssegers\Raven\RavenServiceProvider::class);
```

Then add this to your exception handler in `app/Exceptions/Handler.php`:

```
use Jenssegers\Raven\Facades\Raven;
```

And:

```
public function report(Exception $e)
{
    if ($this->shouldReport($e)) {
        Raven::error($e);
    }

    parent::report($e);
}
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 99% 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 ~44 days

Recently: every ~74 days

Total

24

Last Release

3369d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.3

v1.5.0PHP &gt;=5.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/91980fbd02c3e65e0b2ec1c65e4ca0131f1bbc3929a0a11a7f4f12db5f2036e3?d=identicon)[jenssegers](/maintainers/jenssegers)

---

Top Contributors

[![jenssegers](https://avatars.githubusercontent.com/u/194377?v=4)](https://github.com/jenssegers "jenssegers (102 commits)")[![nirradian](https://avatars.githubusercontent.com/u/9128182?v=4)](https://github.com/nirradian "nirradian (1 commits)")

---

Tags

laravelloggingmonitoringerrorsentryravengetsentry

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jenssegers-raven/health.svg)

```
[![Health](https://phpackages.com/badges/jenssegers-raven/health.svg)](https://phpackages.com/packages/jenssegers-raven)
```

###  Alternatives

[sentry/sentry-laravel

Laravel SDK for Sentry (https://sentry.io)

1.3k114.3M154](/packages/sentry-sentry-laravel)[rollbar/rollbar-laravel

Rollbar error monitoring integration for Laravel projects

14110.4M7](/packages/rollbar-rollbar-laravel)[jenssegers/rollbar

Rollbar error monitoring integration for Laravel projects

3301.1M2](/packages/jenssegers-rollbar)[saasscaleup/laravel-log-alarm

Laravel log Alarm help you to set up alarm when errors occur in your system and send you a notification via Slack and email

27025.0k](/packages/saasscaleup-laravel-log-alarm)[lordsimal/cakephp-sentry

Sentry plugin for CakePHP

12270.3k](/packages/lordsimal-cakephp-sentry)

PHPackages © 2026

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