sppeerit / airbrake-bundle
此包已被废弃,不再维护。未建议替代包。
Airbrake API v3 集成,适用于 Symfony3 >=
2.2.0
2017-12-08 18:01 UTC
Requires
- php: ^7.0
- airbrake/phpbrake: ~0.5.0
- symfony/framework-bundle: ~3.0|~4.0
Requires (Dev)
- phpunit/phpunit: ^6.0.0
- squizlabs/php_codesniffer: ^2.5.1
README
这是对原始 https://github.com/aminin/airbrake-bundle 包的分支,对开发者表示衷心的感谢。
先决条件
此版本包需要 Symfony 3.0+
安装
步骤 1: 使用 composer 下载 SpeeritAirbrakeBundle
在您的 composer.json 中添加 SpeeritAirbrakeBundle
$ composer require speerit/airbrake-bundle
步骤 2: 启用包
在内核中启用包
// app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Speerit\AirbrakeBundle\SpeeritAirbrakeBundle(), ); }
步骤 3: 配置 SpeeritAirbrakeBundle
将以下配置添加到您的 config.yml
文件中
# app/config/config.yml speerit_airbrake: project_id: YOUR-PROJECT-ID project_key: YOUR-API-KEY
配置参考
speerit_airbrake: # This parameter is required # For Errbit the exact value of project_id doesn't matter project_id: YOUR-PROJECT-ID # Omit this key if you need to enable/disable the bundle temporarily # If not given, this bundle will ignore all exceptions and won't send any data to remote. project_key: YOUR-API-KEY # By default, it is set to api.airbrake.io. # A host is a web address containing a scheme ("http" or "https"), a host and a port. # You can omit the scheme ("https" will be assumed) and the port (80 or 443 will be assumed). host: http://errbit.localhost:8000 # You might want to ignore some exceptions such as http not found, access denied etc. # By default this bundle ignores all HttpException instances. (includes HttpNotFoundException, AccessDeniedException) # To log all exceptions leave this array empty. ignored_exceptions: ["Symfony\Component\HttpKernel\Exception\HttpException"]
用法
配置完成后,包将自动将异常/错误发送到 airbrake 服务器。
许可
此包受 MIT 许可证保护。请参阅完整的许可证,见 Resources/meta/LICENSE