marcopollacci/sentryexpressive

连接 Zend Expressive 框架到 Sentry 的实用工具

1.0 2019-06-19 07:17 UTC

This package is auto-updated.

Last update: 2024-09-20 00:23:26 UTC


README

Build Status Maintainability Latest Stable Version Total Downloads License composer.lock

Average time to resolve an issue Percentage of issues still open

Sentry Delegator for Zend Expressive Framework

使用 Composer 安装

composer require marcopollacci/sentryexpressive

用法

  1. 在配置文件中设置 sentry 令牌和 dsn(如果没有提供配置,则不会向 Sentry 发送异常)。例如
return [
    'sentry' => [
        'dsn' => 'https://<your url>>/<your id>',
        'environment' => 'produzione' #optional
    ]
];
  1. 享受它:D!

try / catch 语句中的附加用法

代码示例

        try {
            throw new \Exception('something');
        }catch(\Exception $e){
            \Sentry\captureException($e);
            /* something else you want */
        }