2017 © Pedro Peláez
 

library yii2-sentry

Sentry for the Yii2 PHP framework.

image

lesha888/yii2-sentry

Sentry for the Yii2 PHP framework.

  • Thursday, November 9, 2017
  • by lesha888
  • Repository
  • 1 Watchers
  • 0 Stars
  • 23 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 17 Forks
  • 0 Open issues
  • 11 Versions
  • 10 % Grown

The README.md

yii-sentry

Latest Stable Version, (*1)

Sentry for the Yii PHP framework 2., (*2)

ecom/sentry is an extension for Yii2 that allows for sending data to Sentry. It comes with an application component that allows for centralized access to the Raven client, an error handler that sends errors and exception to Sentry and a log route that sends log messages to Sentry. It has never been this easy to professionally manage your errors., (*3)

Features

  • Application component for easy access to the Raven client
  • Error handler that sends errors to Sentry
  • Log route that sends messages to Sentry

Resources

Setup

The easiest way to install this extension is to use Composer by adding the following to your composer.json file:, (*4)

  "require": {
    "lesha888/yii2-sentry": "^1.3"
  }

Run the following command in the root directory of your project to install the extension:, (*5)

php composer.phar install

TIP: Create a path alias to Composer's vendor directory called vendor to ease class mapping to dependencies by adding it to aliases in your application configuration., (*6)

If you do not want to use Composer, you can download the extension and its dependencies and set everything up manually., (*7)

Once you have downloaded the extension add the following to your application configuration:, (*8)

  'components' => array(
    'sentry' => array(
      'class' => lesha888\sentry\Component::class,
      'enabled' => true,
      'dsn' => '<replace-with-your-sentry-dsn>'
    ),
  ),

The following configuration parameters are available for the SentryClient:, (*9)

  • dsn: (string) dsn to use when connecting to Sentry
  • environment: (string) name of the active environment
  • enable: (bool) to skip collecting errors
  • enabledEnvironments: (array) list of names for environments in which data will be sent to Sentry
  • options: (array) options to pass to the Raven client with the following structure:
    • logger: (string) name of the logger
    • auto_log_stacks: (bool) whether to automatically log stacktraces
    • name: (string) name of the server
    • site: (string) name of the installation
    • tags: (array) key/value pairs that describe the event
    • trace: (bool) whether to send stacktraces
    • timeout: (int) timeout when connecting to Sentry (in seconds)
    • exclude: (array) class names of exceptions to exclude
    • shift_vars: (bool) whether to shift variables when creating a backtrace
    • processors: (array) list of data processors

Sending errors to Sentry

To enable the SentryErrorHandler add the following to your application configuration:, (*10)

  'components' => array(
    'errorHandler' => array(
      'class' => lesha888\sentry\ErrorHandler::class,
    ),
  ),

The following configuration parameters are available for the SentryErrorHandler:, (*11)

  • sentryClientID: (string) component ID for the sentry client

That's it, now errors and exceptions will be sent to Sentry., (*12)

Sending log messages to Sentry

To enable the SentryLogRoute add the following to your application configuration:, (*13)

  'components' => array(
    'log' => array(
      'class' => 'CLogRouter',
      'routes' => array(
        array(
          'class' => lesha888\sentry\LogRoute::class,
          'levels' => 'error, warning',
        ),
      ),
    ),
  ),

The following configuration parameters are available for the SentryLogRoute:, (*14)

  • sentryClientID: (string) component ID for the sentry client

That's it, now log messages with levels error and warning will be sent to Sentry., (*15)

TIP: Do not log messages with level trace to Sentry because it will slow down your application a lot., (*16)

The Versions

09/11 2017

dev-master

9999999-dev

Sentry for the Yii2 PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

log yii2 exception sentry error

09/11 2017

1.3.1

1.3.1.0

Sentry for the Yii2 PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

log yii2 exception sentry error

09/11 2017

1.3.2

1.3.2.0

Sentry for the Yii2 PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

log yii2 exception sentry error

10/02 2014

1.3.0

1.3.0.0

Sentry for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

log exception yii sentry error

10/02 2014

dev-develop

dev-develop

Sentry for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

log exception yii sentry error

14/10 2013

1.2.1

1.2.1.0

Sentry for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

log exception yii sentry error

13/10 2013

1.2.0

1.2.0.0

Sentry for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

log exception yii sentry error

13/10 2013

1.1.2

1.1.2.0

Sentry for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

log exception yii sentry error

13/10 2013

1.1.1

1.1.1.0

Sentry for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

log exception yii sentry error

13/10 2013

1.1.0

1.1.0.0

Sentry for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

log exception yii sentry error

12/10 2013

1.0.0

1.0.0.0

Sentry for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

log exception yii sentry error