duxet/sentry-symfony

此包已被废弃,不再维护。作者建议使用 sentry/sentry-symfony 包。

Sentry 的 Symfony 集成(http://getsentry.com)

0.8.0 2017-04-27 11:36 UTC

README

Sentry 的 集成

Build Status

安装

步骤 1: 下载包

打开命令行控制台,进入您的项目目录并执行以下命令以下载此包的最新稳定版本

$ composer require sentry/sentry-symfony

此命令要求您全局安装了 Composer,如 Composer 文档中的 安装章节 所述。

步骤 2: 启用包

然后,通过将其添加到项目中 app/AppKernel.php 文件中注册的包列表中来启用该包

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new Sentry\SentryBundle\SentryBundle(),
        );

        // ...
    }

    // ...
}

步骤 3: 配置 SDK

将您的 DSN 添加到 app/config/config.yml

sentry:
    dsn: "https://public:secret@sentry.example.com/1"

配置

以下内容可以通过 app/config/config.yml 进行配置

app_path

您应用程序的基础路径。用于去除前缀并标记框架为应用程序的一部分。

sentry:
    app_path: "/path/to/myapp"

dsn

sentry:
    dsn: "https://public:secret@sentry.example.com/1"

environment

您的代码运行的运行环境(例如,生产)。

sentry:
    environment: "%kernel.environment%"

release

您应用程序的版本。通常这是 git sha。

sentry:
    release: "beeee2a06521a60e646bbb8fe38702e61e4929bf"

prefixes

要从文件名中去除的列表前缀。通常这些是供应商的 include 路径。

sentry:
    prefixes:
        - /usr/lib/include

跳过某些异常

sentry:
    skip_capture:
        - "Symfony\\Component\\HttpKernel\\Exception\\HttpExceptionInterface"

错误类型

定义应报告哪些错误类型。

sentry:
    error_types: E_ALL & ~E_DEPRECATED & ~E_NOTICE