Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/letme.watchman/lib/ErrorHandler/ |
Upload File : |
<?php namespace Letme\Watchman\ErrorHandler; use Bitrix\Main\Context; use Bitrix\Main\Diag\FileExceptionHandlerLog; use Letme\Watchman\Drivers\Driver; use Letme\Watchman\Drivers\Manager; use Letme\Watchman\ErrorHandler\Filter\IsLowPriorityError; use Letme\Watchman\ErrorHandler\Filter\IsPhpCommandLine; use Letme\Watchman\Report\Report; use Letme\Watchman\Issues\Action\AddReport; class Handler extends FileExceptionHandlerLog { protected function getFilters(string $exception, $logType) { return [ new IsLowPriorityError($logType ?: -1), new IsPhpCommandLine(Context::getCurrent()->getRequest()) ]; } public function write($exception, $logType) { foreach ($this->getFilters($exception, $logType) as $filter) { if ($filter->run()) { return; } } $report = Report::makeByException($exception); try { $result = (new AddReport())->execute($report); if ($result->isNew) { Manager::getActive()->map( function (Driver $driver) use ($report, $result) { try { $driver->send($report); // @codingStandardsIgnoreLine } catch (\Throwable $exception) { } } ); } // @codingStandardsIgnoreLine } catch (\Throwable $exception) { sleep($exception); } parent::write($exception, $logType); } }