PHPackages                             musoftware/logger-laravel - 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. musoftware/logger-laravel

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

musoftware/logger-laravel
=========================

Laravel SDK for Musoftware

5.0.3(2y ago)023MITPHPPHP ^7.2 | ^8.0

Since Apr 27Pushed 2y agoCompare

[ Source](https://github.com/musoftware/logger-laravel)[ Packagist](https://packagist.org/packages/musoftware/logger-laravel)[ RSS](/packages/musoftware-logger-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (13)Versions (92)Used By (0)

 [ ![Sentry](https://camo.githubusercontent.com/63d7d9ecd366a58bdf965da3824d392a4ef345b8097753faa12ae07738ac8431/68747470733a2f2f73656e7472792d6272616e642e73746f726167652e676f6f676c65617069732e636f6d2f73656e7472792d776f72646d61726b2d6461726b2d3238307838342e706e67) ](https://sentry.io?utm_source=github&utm_medium=logo)

*Bad software is everywhere, and we're tired of it. Sentry is on a mission to help developers write better software faster, so we can get back to enjoying technology. If you want to join us [**Check out our open positions**](https://sentry.io/careers/)*

Official Sentry SDK for Laravel
===============================

[](#official-sentry-sdk-for-laravel)

[![CI](https://github.com/getsentry/sentry-laravel/actions/workflows/ci.yaml/badge.svg)](https://github.com/getsentry/sentry-laravel/actions/workflows/ci.yaml)[![Latest Stable Version](https://camo.githubusercontent.com/2cf66464e74b5e67198c64874406544334ba4a8c1b2fe337c800151a0b3be04e/68747470733a2f2f706f7365722e707567782e6f72672f73656e7472792f73656e7472792d6c61726176656c2f762f737461626c65)](https://packagist.org/packages/sentry/sentry-laravel)[![License](https://camo.githubusercontent.com/15b65fecd16264d1abef892762ab424529548e6e3549ed84e6bf67128df5f501/68747470733a2f2f706f7365722e707567782e6f72672f73656e7472792f73656e7472792d6c61726176656c2f6c6963656e7365)](https://packagist.org/packages/sentry/sentry-laravel)[![Total Downloads](https://camo.githubusercontent.com/4b8ac805c9334fbca22a6cb3312218cad8b3510c58cddbb2c73ed702eab2593d/68747470733a2f2f706f7365722e707567782e6f72672f73656e7472792f73656e7472792d6c61726176656c2f646f776e6c6f616473)](https://packagist.org/packages/sentry/sentry-laravel)[![Monthly Downloads](https://camo.githubusercontent.com/ce504160ae30755a1236939b20e35fd6b4c6dce5c6b552ee9b2b529b41a95a2c/68747470733a2f2f706f7365722e707567782e6f72672f73656e7472792f73656e7472792d6c61726176656c2f642f6d6f6e74686c79)](https://packagist.org/packages/sentry/sentry-laravel)[![Discord](https://camo.githubusercontent.com/2da2973533965a9404e5ef0683e6cd8192988281f5860256076294e906b9c40c/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f363231373738383331363032323231303634)](https://discord.gg/cWnMQeA)

This is the official Laravel SDK for [Sentry](https://sentry.io).

Getting Started
---------------

[](#getting-started)

The installation steps below work on versions 8.x, 9.x and 10.x of the Laravel framework.

For older Laravel versions and Lumen see:

- [Laravel 8.x &amp; 9.x &amp; 10.x](https://docs.sentry.io/platforms/php/guides/laravel/)
- [Laravel 6.x &amp; 7.x](https://docs.sentry.io/platforms/php/guides/laravel/other-versions/laravel6-7/)
- [Laravel 5.x](https://docs.sentry.io/platforms/php/guides/laravel/other-versions/laravel5/)
- [Laravel 4.x](https://docs.sentry.io/platforms/php/guides/laravel/other-versions/laravel4/)
- [Lumen](https://docs.sentry.io/platforms/php/guides/laravel/other-versions/lumen/)

### Install

[](#install)

Install the `sentry/sentry-laravel` package:

```
composer require sentry/sentry-laravel
```

Enable capturing unhandled exception to report to Sentry by making the following change to your `app/Exceptions/Handler.php`:

```
use Sentry\Laravel\Integration;

public function register(): void
{
    $this->reportable(function (Throwable $e) {
        Integration::captureUnhandledException($e);
    });
}
```

> Alternatively, you can configure Sentry as a [Laravel Log Channel](https://docs.sentry.io/platforms/php/guides/laravel/usage/#log-channels), allowing you to capture `info` and `debug` logs as well.

### Configure

[](#configure)

Configure the Sentry DSN with this command:

```
php artisan sentry:publish --dsn=___PUBLIC_DSN___
```

It creates the config file (`config/sentry.php`) and adds the `DSN` to your `.env` file.

```
SENTRY_LARAVEL_DSN=___PUBLIC_DSN___
```

### Usage

[](#usage)

```
use function Sentry\captureException;

try {
    $this->functionThatMayFail();
} catch (\Throwable $exception) {
    captureException($exception);
}
```

To learn more about how to use the SDK [refer to our docs](https://docs.sentry.io/platforms/php/guides/laravel/).

Laravel Version Compatibility
-----------------------------

[](#laravel-version-compatibility)

The Laravel and Lumen versions listed below are all currently supported:

- Laravel `>= 10.x.x` on PHP `>= 8.1` is supported starting from `3.2.0`
- Laravel `>= 9.x.x` on PHP `>= 8.0` is supported starting from `2.11.0`
- Laravel `>= 8.x.x` on PHP `>= 7.3` is supported starting from `1.9.0`
- Laravel `>= 7.x.x` on PHP `>= 7.2` is supported starting from `1.7.0`
- Laravel `>= 6.x.x` on PHP `>= 7.2` is supported starting from `1.2.0`

Please note that starting with version `>= 2.0.0` we require PHP Version `>= 7.2` because we are using our new [PHP SDK](https://github.com/getsentry/sentry-php) underneath.

The Laravel versions listed below were supported in previous versions of the Sentry SDK for Laravel:

- Laravel `
