silverback/yii-google-cloud-error-reporting

There is no license information available for the latest version (1.0.0) of this package.

1.0.0 2018-07-05 07:38 UTC

This package is auto-updated.

Last update: 2024-04-26 20:38:53 UTC


README

Installation

Clone this repository in protected/extensions/yii-stackdriver.

Launch a composer update to download required dependencies.

Config

Add the log route to CLogRouter to pipe logs in Google Cloud Logging.

'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',
			)
		),
		...
	)
)

Customize the class for error handling in config.

'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,
),

Authorize the GCE VM service account with the following privileges:

  • Error Reporting Author
  • Logs Author