https://github.com/silverbackstudio/yii-stackdriver
Send Yii log and exceptions to Stackdriver
https://github.com/silverbackstudio/yii-stackdriver
google google-cloud google-cloud-logging logging php stackdriver yii
Last synced: 4 months ago
JSON representation
Send Yii log and exceptions to Stackdriver
- Host: GitHub
- URL: https://github.com/silverbackstudio/yii-stackdriver
- Owner: silverbackstudio
- Created: 2018-07-02T15:38:18.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-05T07:41:05.000Z (over 7 years ago)
- Last Synced: 2024-11-18T09:57:52.132Z (about 1 year ago)
- Topics: google, google-cloud, google-cloud-logging, logging, php, stackdriver, yii
- Language: PHP
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Yii 1.x - Google Cloud (Stackdriver) Monitoring
## 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.
```php
'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.
```php
'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