logsentrydev / logsentry-laravel
LogSentry integration for Laravel
Fund package maintenance!
xqus
Requires
- php: ^8.2||^8.3||^8.4
- illuminate/contracts: ^11.0||^12.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.9||^3.0
- laravel/pint: ^1.14
- monolog/monolog: ^3.8
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^10.0.0||^9.0.0||^8.22.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/extension-installer: ^1.3||^2.0
- phpstan/phpstan-deprecation-rules: ^1.1||^2.0
- phpstan/phpstan-phpunit: ^1.3||^2.0
- spatie/laravel-ray: ^1.35
README
Integrate your Laravel application with LogSentry
Installation
You can install the package via composer:
composer require logsentrydev/logsentry-laravel
You can publish the config file with:
php artisan vendor:publish --tag="logsentry-config"
This is the contents of the published config file:
return [ 'secret' => env('LOGSENTRY_SECRET'), 'endpoint' => env('LOGSENTRY_ENDPOINT', 'https://logsentry.dev/api/v1/event'), ];
Usage
Note
In order to use this package you need a free LogSentry account. You also need to create an API key under your account.
- Add the following to the
channels
key in yourconfig/logging.php
file
use LogSentry\Laravel\LogSentryLogHandler; ... 'channels' => [ 'logsentry' => [ 'driver' => 'monolog', 'handler' => LogSentryLogHandler::class, 'with' => [ ], ], .... ],
- Set your logging channel to
logsentry
in your.env
file.
LOG_CHANNEL=logsentry
- Add your API key to your .env file. For example:
LOGSENTRY_SECRET="1|APl3KOP8vKDRuNS2SwvCEjn3whO6lXWODlPOz9b44e9daf29"
Testing
composer test
License
The MIT License (MIT). Please see License File for more information.