Coder Social home page Coder Social logo

sentry-flow's Introduction

Latest Stable Version Total Downloads License

This is a Sentry client package for the Flow framework.

Have a look at https://sentry.io for more information about Sentry.

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, ^6.0, ^7.0 ^3.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):

PunktDe:
  Sentry:
    Flow:
      dsn: 'https://[email protected]/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:

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:

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:

<?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:

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.

sentry-flow's People

Contributors

daniellienert avatar fnkr avatar thedex avatar andrehoffmann30 avatar kabarakh avatar sebobo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.