bitweb/error-reporting

BitWeb 扩展,用于将错误发送到电子邮件。

1.1.1 2016-12-28 12:05 UTC

This package is auto-updated.

Last update: 2024-09-21 19:47:27 UTC


README

构建状态 覆盖率状态 ##使用方法

在 index.php 文件中,在自动加载之后添加此代码。

$errorService = new \BitWeb\ErrorReporting\Service\ErrorService(array(
    'errorReportingLevel' => E_ALL,
    'subject' => '[Errors][your-app-id-here]',
    'emails' => array (
        'you@domain.com'
    ),
    'from_address' => 'you@domain.com',
    'ignore404' => false,
    'ignoreBot404' => false,
    'botList' => array(
        'AhrefsBot',
        'bingbot',
        'Ezooms',
        'Googlebot',
        'Mail.RU_Bot',
        'YandexBot',
    ),
    'ignorableExceptions' => array(
        'ErrorException'
    ),
    'ignorablePaths' => array (
        'paths/to/ignore'
    )
));
$errorService->startErrorHandling();

将此代码添加到 index.php 的最后一行。

$errorService->endErrorHandling();

配置