0
7
Login
Code
Issues
Pull requests
Events
Packages
47ecd75a3eb5213d5d89e9f2ae23f82911370080
47ecd75a3eb5213d5d89e9f2ae23f82911370080

Sentry

Latest Test Latest Version on Packagist Total Downloads GitHub license

Installation

composer require friendsofhyperf/sentry

Publish config file

php bin/hyperf.php vendor:publish friendsofhyperf/sentry

Register exception handler

return [
    'handler' => [
        'http' => [
            FriendsOfHyperf\Sentry\SentryExceptionHandler::class,
            App\Exception\Handler\AppExceptionHandler::class,
        ],
    ],
];

Register logger handler

<?php

return [
    // ...
    'sentry' => [
        'handler' => [
            'class' => FriendsOfHyperf\Sentry\SentryHandler::class,
            'constructor' => [
                'level' => \Monolog\Logger::DEBUG,
            ],
        ],
        'formatter' => [
            'class' => \Monolog\Formatter\LineFormatter::class,
            'constructor' => [
                'format' => null,
                'dateFormat' => null,
                'allowInlineLineBreaks' => true,
            ]
        ],
    ],
    // ...
];