slashtrace / slashtrace-sentry

Sentry handler for SlashTrace

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SlashTrace - Awesome error handler - Sentry handler

This is the Sentry handler for SlashTrace. Use it to send your errors and exceptions to your Sentry account.

Usage

  1. Install using Composer:

    composer require slashtrace/slashtrace-sentry
    
  2. Hook it into SlashTrace:

    use SlashTrace\SlashTrace;
    use SlashTrace\Sentry\SentryHandler;
    
    $handler = new SentryHandler("https://abcdefghijklmnopqrstuvwxyz123456@sentry.io/123456"); // <- Your Sentry DSN. Get it from your projects settings on sentry.io
     
    $slashtrace = new SlashTrace();
    $slashtrace->addHandler($handler);

    Alternatively, you can pass in a pre-configured Sentry client when you instantiate the handler:

    $client = Sentry\ClientBuilder::create(["dsn" => "..."]);
    $handler = new SentryHandler($client);
    
    $slashtrace->addHandler($handler);
    

Read the SlashTrace docs to see how to capture errors and exceptions, and how to attach additional data to your events.

About

Sentry handler for SlashTrace

License:MIT License


Languages

Language:PHP 100.0%