PHPackages                             mindaugasjackunaspc/sentry-module - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. mindaugasjackunaspc/sentry-module

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

mindaugasjackunaspc/sentry-module
=================================

This module allows integration of Sentry Client into laminas and mezzio

3.0.1(4y ago)05MITPHPPHP ^7.2

Since Apr 12Pushed 4y agoCompare

[ Source](https://github.com/mindaugasjackunaspc/sentry-module)[ Packagist](https://packagist.org/packages/mindaugasjackunaspc/sentry-module)[ Docs](https://github.com/facile-it/sentry-module)[ RSS](/packages/mindaugasjackunaspc-sentry-module/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (13)Versions (29)Used By (0)

ZF Sentry Module
================

[](#zf-sentry-module)

[![Build Status](https://camo.githubusercontent.com/88693cda39ce3c2ca8dc6a118d544993ea1e57884a93e61a9df89d88fb3825e4/68747470733a2f2f6170692e7472617669732d63692e6f72672f666163696c652d69742f73656e7472792d6d6f64756c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/facile-it/sentry-module)[![Code Coverage](https://camo.githubusercontent.com/d19e5e42a5b4b13a85b3d967ca54c14aab97f75eb939b686d9677ad3c7ea3cc7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f666163696c652d69742f73656e7472792d6d6f64756c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/facile-it/sentry-module/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/1335bafef76b4268d6021a64cd219253953afb557eadb15b13a6ed4d948f353f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f666163696c652d69742f73656e7472792d6d6f64756c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/facile-it/sentry-module/?branch=master)

This module allows integration with Sentry Client into laminas and mezzio.

Installation
------------

[](#installation)

The only supported way to install this module is trough composer. For composer documentation you can refer to [getcomposer.org](http://getcomposer.org).

Install with implementations of [php-http/async-client-implementation](https://packagist.org/providers/php-http/async-client-implementation) and [psr/http-message-implementation](https://packagist.org/providers/psr/http-message-implementation):

```
php composer.phar require facile-it/sentry-module php-http/curl-client laminas/laminas-diactoros

```

Configuration
-------------

[](#configuration)

### Client

[](#client)

To configure an instance of the client you can do as below:

```
return [
    'sentry' => [
        'disable_module' => false,
        'options' => [
            'dsn' => '',
            // other sentry options
            // https://docs.sentry.io/error-reporting/configuration/?platform=php
        ],
        'javascript' => [
            'inject_script' => false,
            'script' => [
                'src' => 'https://browser.sentry-cdn.com/5.6.3/bundle.min.js',
                'integrity' => 'sha384-/Cqa/8kaWn7emdqIBLk3AkFMAHBk0LObErtMhO+hr52CntkaurEnihPmqYj3uJho',
                'crossorigin' => 'anonymous',
            ],
            'options' => [
                'dsn' => '',
                // other sentry options
                // https://docs.sentry.io/error-reporting/configuration/?platform=php
            ],
        ],
    ],
];
//...
```

Now you can use the client and the Hub by retrieving it from the Service Locator.

```
use Sentry\HubInterface;

$hub = $this->getServiceLocator()->get(HubInterface::class);
```

### Error Handler Listener

[](#error-handler-listener)

This module provides a listener for `MvcEvent::EVENT_DISPATCH_ERROR` and `MvcEvent::EVENT_RENDER_ERROR` events in order to log the exceptions caught in these events.

If you want to use it you should register it in your application module.

#### Example:

[](#example)

```
