2017 © Pedro Peláez
 

yii2-extension yii2-google-debugger

Use Google Cloud Logger into your Yii projects

image

inquid/yii2-google-debugger

Use Google Cloud Logger into your Yii projects

  • Wednesday, February 21, 2018
  • by gogl92
  • Repository
  • 1 Watchers
  • 0 Stars
  • 34 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 62 % Grown

The README.md

Yii Framework , (*1)

Donate, (*2)

Google Debugger for Yii

Use Google Cloud Logger into your Yii projects, (*3)

Installation

The preferred way to install this extension is through composer., (*4)

Either run, (*5)

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

or add, (*6)

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

to the require section of your composer.json file., (*7)

Usage

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

        '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, (*9)

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, (*10)

SUPPORT

paypal, (*11)

The Versions

21/02 2018

dev-master

9999999-dev

Use Google Cloud Logger into your Yii projects

  Sources   Download

Apache-2.0

The Requires

 

by Inquid

logger extension yii2 google debugger google cloud target

21/02 2018

v0.2

0.2.0.0

Use Google Cloud Logger into your Yii projects

  Sources   Download

Apache-2.0

The Requires

 

by Inquid

logger extension yii2 google debugger google cloud target

21/02 2018

v0.1

0.1.0.0

Use Google Cloud Logger into your Yii projects

  Sources   Download

Apache-2.0

The Requires

 

by Inquid

logger extension yii2 google debugger google cloud target