https://github.com/owenvoke/laravel-zero-sentry-example
An example repository showing how to set up Sentry logging in Laravel Zero.
https://github.com/owenvoke/laravel-zero-sentry-example
laravel laravel-zero php sentry-laravel sentry-php
Last synced: 3 months ago
JSON representation
An example repository showing how to set up Sentry logging in Laravel Zero.
- Host: GitHub
- URL: https://github.com/owenvoke/laravel-zero-sentry-example
- Owner: owenvoke
- Created: 2019-09-23T08:56:09.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-23T09:05:08.000Z (almost 6 years ago)
- Last Synced: 2025-01-26T12:11:22.566Z (5 months ago)
- Topics: laravel, laravel-zero, php, sentry-laravel, sentry-php
- Language: PHP
- Homepage: https://laravel-zero.com
- Size: 29.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Laravel Zero Sentry Example
## Install
1. Install the required Illuminate dependencies:
```bash
$ composer require illuminate/queue:^5.8
$ composer require illuminate/log:^5.8
```
1. Install the required Sentry dependencies:
```bash
$ composer require sentry/sentry-laravel:^1.2
```
1. Register the required service providers in [`config/app.php`](config/app.php):
```diff
+ Illuminate\Log\LogServiceProvider::class,
+ Illuminate\Queue\QueueServiceProvider::class,
+ Sentry\Laravel\ServiceProvider::class,
```
1. Create a new custom exception handler class under [`App\Exceptions\Handler`](app/Exceptions/Handler.php)
1. Register the new exception handler under [`bootstrap/app.php`](bootstrap/app.php):
```diff
- Illuminate\Foundation\Exceptions\Handler::class
+ App\Exceptions\Handler::class
```## Usage
This requires the `SENTRY_LARAVEL_DSN` environment variable to be set in your `.env` file, or global environment.
Throw an exception in a command to test. Or run the Sentry test command using `php application sentry:test`.