nfedoseev / yii2-external-target
External logs target for the Yii framework
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 558
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: *
- yiisoft/yii2-httpclient: ~2.0.0
README
This extension provides the logging target for the Yii framework 2.0.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist nfedoseev/yii2-external-target
or add
"nfedoseev/yii2-external-target": "*"
to the require section of your composer.json.
Configuring application
After extension is installed you need to setup log target class:
'components' => [ 'errorHandler' => [ 'errorAction' => 'site/error', 'class' => 'nfedoseev\yii2\ExternalTarget\ErrorHandler', ], 'logClient' => [ 'class' => 'nfedoseev\yii2\ExternalTarget\LogClient', 'baseUrl' => 'your_logger_collector_url', 'site' => 'your_site_identity', 'user_id' => 'id', 'ignore_statuses' => [200] ], 'log' => [ 'traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [ [ 'class' => 'nfedoseev\yii2\ExternalTarget\LogTarget', 'levels' => ['error'], 'categories' => ['yii\db\*', 'app\*'], ], ... ], ], ... ], ...