lordphnx/cake-sentry-errorlogger
最新稳定版本:1.0.3
Composer 安装命令:
composer require lordphnx/cake-sentry-errorlogger
包简介
A CakePHP ErrorLogger implementation that logs to Sentry
README 文档
README
Since CakePHP 4.4, the error handlers have been updated to ErrorTrap and ExceptionTrap.
Both use Cake\Error\ErrorLoggerInterface, making packages such as connehito/CakeSentry less interesting.
This repository provides a Sentry implementation of the Cake\Error\ErrorLoggerInterface
Configure
In your config/bootstrap.php
/*
* Register application error and exception handlers.
*/
$errorConfig = Cake\Core\Configure::consume('Error');
//if sentry, log to SentryErrorLogger
if (Configure::read('Sentry.dsn', false)) {
$errorConfig = [
...$errorConfig,
'logger' => SentryErrorLogger::class
];
}
(new ErrorTrap($errorConfig))->register();
(new ExceptionTrap($errorConfig))->register();
In your config/app.php
you can either use the Sentry key
[
'Sentry' => [
'dsn' => '......'
]
or Error.Sentry
[
/*...*/
'Error' => [
/*....*/
'Sentry' => [
'dsn' => '......'
]
]
Setting options
Global
Per Error/Exception
统计信息
- 总下载量: 205
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: mit
- 更新时间: 2022-09-14