m8rge/yii2-pinba-log-target

Pinba log target for Yii2

dev-master 2018-11-12 12:41 UTC

This package is auto-updated.

Last update: 2024-10-13 01:43:13 UTC


README

Add to yii2 config:

[
    'components' => [
        'log' => [
            'targets' => [
                [
                    'class' => \m8rge\pinba\PinbaLogTarget::class,
                    'pinbaHost' => 'pinba.engine.host.name.com', // required
                    'enabled' => true,
                    'serverName' => 'myapp.com', // especially usefull in cli scripts
                    'excludeScriptNames' => ['/debug/*'], // do not profile debug panel
                ],
            ],
        ],
    ],
],

Profile in code:

\Yii::beginProfile($token, $category . '::' . $method);
// ...
\Yii::endProfile($token, $category . '::' . $method);