PHP code example of silverback / yii-google-cloud-error-reporting

1. Go to this page and download the library: Download silverback/yii-google-cloud-error-reporting 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/ */

    

silverback / yii-google-cloud-error-reporting example snippets



'log'=>array(
	'class'=>'CLogRouter',
	'routes'=>array(
		array(
			'class'=>'ext.yii-stackdriver.StackdriverLogRoute',
			'levels'=>'error, warning, info, profile, debug',
			
			// override error severity for some exceptions
			'errorSeverity' => array(
				'exception.CHttpException.404' => 'info',
			)
		),
		...
	)
)


'errorHandler'=>array(
	// use 'site/error' action to display errors
	'class'=>'ext.yii-stackdriver.StackdriverErrorHandler',
	'errorAction'=>'site/error',
	
	// do not consider 404 as errors/exceptions
	'skip404' => true,
),