定制 inquid/yii2-google-debugger 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

inquid/yii2-google-debugger

Composer 安装命令:

composer require inquid/yii2-google-debugger

包简介

Use Google Cloud Logger into your Yii projects

README 文档

README

Yii Framework

Donate

Google Debugger for Yii

Use Google Cloud Logger into your Yii projects

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist inquid/yii2-google-debugger "*"

or add

"inquid/yii2-google-debugger": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply generate a service account with Cloud Debugger Agent permissions and configure your target as the following:

        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                'googleCloud' => [
                    'class' => 'inquid\google_debugger\GoogleCloudLogger',
                    'categories' => ['cat1','cat2'], //Your categories to log
                    'levels' => ['info', 'trace', 'warning', 'error'],
                    'except' => ['yii\web\HttpException:*', 'yii\i18n\I18N\*'],
                    'prefix' => function () {
                        $url = !Yii::$app->request->isConsoleRequest ? Yii::$app->request->getUrl() : null;
                        return sprintf('[%s][%s]', Yii::$app->id, $url);
                    },
                    'projectId' => 'project-id',
                    'loggerInstance' => 'instance-log',
                    'clientSecretPath' => '../google_credentials.json' //path to your service account credentials
                ]
            ],
        ],

And thats it! log as you may log using Yii

Yii::debug('start calculating average revenue',GoogleCloudLogger::CATEGORY);
Yii::warning('Warning');
Yii::info('Info');
Yii::error('Error');

And check them in https://console.cloud.google.com/logs/viewer?project=your_project_id

SUPPORT

paypal

统计信息

  • 总下载量: 13.13k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-02-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固