1. Go to this page and download the library: Download friendsofhyperf/sentry library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
friendsofhyperf / sentry example snippets
# use it send customer log to sentry
//\FriendsOfHyperf\Helpers\logs('project-name', 'sentry')->warning('this is a test warning issue!');
return [
// ...
'sentry' => [
'handler' => [
'class' => FriendsOfHyperf\Sentry\SentryHandler::class,
'constructor' => [
'level' => \Monolog\Level::Debug,
],
],
'formatter' => [
'class' => \Monolog\Formatter\LineFormatter::class,
'constructor' => [
'format' => null,
'dateFormat' => null,
'allowInlineLineBreaks' => true,
]
],
],
// ...
];