basecom/spryker-sentry

This package is abandoned and no longer maintained. No replacement package was suggested.

spryker package to utilize sentry fo php-level error-logging in all layers

Maintainers

👁 basecom

Package info

github.com/basecom/spryker-sentry

Homepage

Issues

pkg:composer/basecom/spryker-sentry

Statistics

Installs: 12 489

Dependents: 0

Suggesters: 0

Stars: 1

0.2.3 2021-10-06 12:42 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT c44287ceb6cdabfad0414e9d050eb6f686d52638

  • Sebastian Kroll <s.kroll.woop@basecom.de>

sentryspryker

This package is auto-updated.

Last update: 2024-07-11 17:48:48 UTC


README

spryker package to utilize sentry fo php-level error-logging in all layers

Installation

Install via composer

$ composer require basecom/spryker-sentry

Integration

  1. Add Basecom to namespaces in config_default.php
$config[KernelConstants::CORE_NAMESPACES][] = 'Basecom';
  1. Add corresponding SentryApplicationPlugin to every layer you want to log errors to sentry

Glue

Add SentryApplicationPlugin to Pyz\Glue\GlueApplication\GlueApplicationDependencyProvider

 protected function getApplicationPlugins(): array
 {
 return [
 ...
 new Basecom\Glue\Sentry\Plugin\Application\SentryApplicationPlugin(),
 ];
 }

Zed

Add SentryApplicationPlugin to Pyz\Zed\Application\ApplicationDependencyProvider

 protected function getApplicationPlugins(): array
 {
 return [
 ...
 new Basecom\Zed\Sentry\Communication\Plugin\Application\SentryApplicationPlugin(),
 ];
 }

Yves

Add SentryApplicationPlugin to Pyz\Yves\ShopApplication\ShopApplicationDependencyProvider

 protected function getApplicationPlugins(): array
 {
 return [
 ...
 new Basecom\Yves\Sentry\Plugin\Application\SentryApplicationPlugin(),
 ];
 }

Console / CLI

Add SentryConsolePlugin to Pyz\Zed\Console\ConsoleDependencyProvider

 public function getEventSubscriber(Container $container)
 {
 $eventSubscriber = parent::getEventSubscriber($container);
 ...
 $eventSubscriber[] = new SentryConsolePlugin();

 return $eventSubscriber;
 }

Configuration

Configure the sentry logger in config_*.php

<?php

use Basecom\Shared\Sentry\SentryConstants;

...

// full sentry DSN. if empty, sentry logging is disabled in this config / environment
$config[SentryConstants::SENTRY_DSN] = 'https://###@###.ingest.sentry.io/###';

// set alternative environment names (per Layer), defaults to $APPLICATION_ENV when not set
$config[SentryConstants::SENTRY_ENVIRONMENT_ZED] = 'stage_zed';
$config[SentryConstants::SENTRY_ENVIRONMENT_GLUE] = 'stage_glue';
$config[SentryConstants::SENTRY_ENVIRONMENT_YVES] = 'stage_yves';
$config[SentryConstants::SENTRY_ENVIRONMENT_CONSOLE] = 'stage_console';

// error types which should be logged
$config[SentryConstants::SENTRY_ERROR_TYPES] = E_ALL ^ E_DEPRECATED ^ E_USER_DEPRECATED