PHP code example of exs / silex-error-provider

1. Go to this page and download the library: Download exs/silex-error-provider 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/ */

    

exs / silex-error-provider example snippets


//...
// Log locations and names
// Max number of error messages to read before logging to DB.
$app['logs.directory'] = __DIR__ . '/../var/logs';
$app['logs.file.exceptions'] = $app['logs.directory'] . '/exceptions.log';
$app['logs.reader.threshold'] = 2000;
//...

use Symfony\Component\Console\Application;
use EXS\ErrorProvider\Commands\LogloaderCommand;

$console = new Application('Log loader command', 'Description here');
$console->addCommands(array(
    new LogloaderCommand('Exception reader', $app['exs.serv.exception.reader'])
));

return $console;
 shell
php composer.phar update
 php
//app.php
//...
$app->register(new \EXS\ErrorProvider\Providers\Services\ErrorServiceProvider());