PHP code example of tekoway / symfony-rollbar

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

    

tekoway / symfony-rollbar example snippets



// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Tekoway\Rollbar\TekowayRollbarBundle(),
        );

        // ...
    }

    // ...
}

    $this->get('tekoway.logger.rollbar')->critical('critical message');
    $this->get('tekoway.logger.rollbar')->info('info message');
    $this->get('tekoway.logger.rollbar')->debug('debug message');
    $this->get('tekoway.logger.rollbar')->error('error message');
    $this->get('tekoway.logger.rollbar')->emergency('emergency message');
    $this->get('tekoway.logger.rollbar')->alert('alert message');
    $this->get('tekoway.logger.rollbar')->notice('notice message');
    $this->get('tekoway.logger.rollbar')->warning('warning message');
yml
    access_token: YOUR_ROLLBAR_ACCESS_TOKEN
    environment: production
    enabled: true
    error_levels: 
        - E_ERROR'
        - E_WARNING
        - E_PARSE
        - E_CORE_ERROR
        - E_CORE_WARNING
        - E_COMPILE_ERROR
        - E_COMPILE_WARNING
        - E_USER_ERROR
        - E_USER_WARNING
        - E_USER_NOTICE
        - E_STRICT
        - E_RECOVERABLE_ERROR
        - E_DEPRECATED
        - E_USER_DEPRECATED
        - E_ALL #