PHP code example of rpr / swoft-sentry

1. Go to this page and download the library: Download rpr/swoft-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/ */

    

rpr / swoft-sentry example snippets


composer 


    'sentryHandler' => [
        'class'     => \Gaodeng\SwoftSentry\SentryHandler::class,
        'dsn'       => 'YOUR SENTRY DSN',
        'formatter' => '${lineFormatter}',
        'curlMethod'=> 'co', //curlMethod可以是co,async和exec
        'levels'    => 'error,info', //2.0.1支持直接逗号分隔的字符串
    ],

    'logger' => [
        'flushRequest' => false,
        'enable'       => true,
        'json'         => true,
        'handlers'     => [
            '${sentryHandler}',   //添加handler
            //...  其他handler
        ],
    ],