logsentrydev/logsentry-laravel

LogSentry integration for Laravel

v0.0.1 2025-02-28 00:04 UTC

This package is auto-updated.

Last update: 2025-02-28 06:36:10 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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.

  1. Add the following to the channels key in your config/logging.php file
use LogSentry\Laravel\LogSentryLogHandler;

...

'channels' => [
    'logsentry' => [
        'driver'  => 'monolog',
        'handler' => LogSentryLogHandler::class,
        'with' => [
        ],
    ],

    ....
],
  1. Set your logging channel to logsentry in your .env file.
LOG_CHANNEL=logsentry
  1. 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.