2017 © Pedro Peláez
 

neos-package sentry-flow

Sends exceptions and additional data to Sentry server using Raven client.

image

punktde/sentry-flow

Sends exceptions and additional data to Sentry server using Raven client.

  • Thursday, May 3, 2018
  • by punktde
  • Repository
  • 9 Watchers
  • 1 Stars
  • 840 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 51 % Grown

The README.md

PunktDe.Sentry.Flow

Latest Stable Version Total Downloads License, (*1)

This is a Sentry client package for the Flow framework., (*2)

Have a look at https://sentry.io for more information about Sentry., (*3)

Installation

$ composer require punktde/sentry-flow

Compatibilty matrix

Flow Sentry Client Flow Sentry SDK Sentry Server
^1.0 ^4.0 ^1.0 *
^2.0 ^5.0 ^1.0 *
^3.0 ^5.0, ^6.0 ^2.0 *
^4.0 ^5.0 - ^8.0 ^3.0 >= v20.6.0
^5.0 ^5.0 - ^9.0 ^4.0 >= v20.6.0

Configuration

Add the following to your Settings.yaml and replace the dsn setting with your project DSN (API Keys in your Sentry project):, (*4)

PunktDe:
  Sentry:
    Flow:
      dsn: 'https://public_key@your-sentry-server.com/project-id'

You can also set the Sentry Environment to filter your exceptions by e.g. dev-/staging-/live-system. Set the env variable SENTRY_ENVIRONMENT or add your value to your Settings.yaml:, (*5)

PunktDe:
  Sentry:
    Flow:
      environment: 'live'

Furthermore you can set the Sentry Release version to help to identifiy with which release an error occurred the first time. By default, a file which is starting with the name RELEASE_ is searched and the values after RELEASE_ is used for Sentry. Alternatively you can override the filebased release number and set an environment variable SENTRY_RELEASE or add your value to your Settings.yaml:, (*6)

PunktDe:
  Sentry:
    Flow:
      release: '5.0.3'

If you need to use a custom transport e.g. to write the sentry reports to a file, you must implement the Sentry\TransportInterface:, (*7)

<?php
declare(strict_types=1);

namespace Vendor\Package\Sentry\Transport;

use Sentry\Event;
use Sentry\Exception\JsonException;
use Sentry\Transport\TransportInterface;
use Sentry\Util\JSON;

class FileWriterTransport implements TransportInterface
{
    /**
     * @param Event $event
     *
     * @return string|null Returns the ID of the event or `null` if it failed to be sent
     *
     * @throws JsonException
     */
    public function send(Event $event): ?string
    {
        if (file_put_contents('My\Path\And\FileName', JSON::encode($event)) !== false) {
            return $event->getId();
        }
        return null;
    }
}

Then you configure the class to be used:, (*8)

PunktDe:
  Sentry:
    Flow:
      transportClass: '\Vendor\Package\Sentry\Transport\FileWriterTransport'

Usage

Sentry will log all exceptions that have the rendering option logException enabled. This can be enabled or disabled by status code or exception class according to the Flow configuration., (*9)

The Versions

03/05 2018

dev-master

9999999-dev

Sends exceptions and additional data to Sentry server using Raven client.

  Sources   Download

MIT

The Requires

 

03/05 2018

3.0.0

3.0.0.0

Sends exceptions and additional data to Sentry server using Raven client.

  Sources   Download

MIT

The Requires

 

03/05 2018

2.0.0

2.0.0.0

Sends exceptions and additional data to Sentry server using Raven client.

  Sources   Download

MIT

The Requires

 

02/02 2018

1.2.0

1.2.0.0

Sends exceptions and additional data to Sentry server using Raven client.

  Sources   Download

MIT

The Requires

 

21/01 2018

1.1.1

1.1.1.0

Sends exceptions and additional data to Sentry server using Raven client.

  Sources   Download

MIT

The Requires

 

15/01 2018

1.1.0

1.1.0.0

Sends exceptions and additional data to Sentry server using Raven client.

  Sources   Download

MIT

The Requires

 

15/01 2018

1.0.0

1.0.0.0

Sends exceptions and additional data to Sentry server using Raven client.

  Sources   Download

MIT

The Requires