PHP code example of libelulasoft / yii2-error-handler

1. Go to this page and download the library: Download libelulasoft/yii2-error-handler 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/ */

    

libelulasoft / yii2-error-handler example snippets


// confing\main.php

'components' => [
  ...,
  'errorHandler' => [
    'errorAction' => 'site/error',
    'class' => \Libelulasoft\ErrorHandler\ErrorHandler::class,
    'loggerComponent' => '', // empty when the logger handler not exists
    'emailConfig' => 'EMAIL_ERROR_NOTIFICATION', // configuration for email
    'configClass' => '/common/models/Configuration', // debe implementar interface config
    'empresa' => $_GET['empresa'] ?? 'undefined',
    'bdConnection' => 'mongodb',
    'saveError' => true,
    'notificate' => true,
    'showTrace' => YII_DEBUG,
    'saveBody' => YII_DEBUG,
    // This exceptions not be save into database
    // And this exceptions not send via email
    'exceptionsNotSave' => [
      \Libelulasoft\ErrorHandler\exceptions\MessageException::class
    ],
  ],
]