PHP code example of chocofamilyme / logformatter

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

    

chocofamilyme / logformatter example snippets


return [
    'domain' => env('APP_DOMAIN', 'api.domain.me'),
];

    'credential'   => [
        'key'       => env('SENTRY_KEY'),
        'projectId' => env('SENTRY_PROJECT_ID'),
        'domain'    => env('SENTRY_DOMAIN'),
    ],
    'options'      => [
        'http_connect_timeout'  => 2,
        'http_timeout'          => 2
    ],
    'environments' => ['production', 'staging'],
    'levels'       => [\Phalcon\Logger::EMERGENCY, \Phalcon\Logger::CRITICAL, \Phalcon\Logger::ERROR],
    'dontReport'   => [
        \Chocofamily\Exception\NoticeException::class    
    ],

$di->setShared('sentry', function () use ($config) {
    return new \Chocofamily\Logger\Adapter\Sentry($config, 'production');
});


 $di->getShared('sentry')->logException($e, \Phalcon\Logger::ERROR);