This extension provides the logging target for the Yii framework 2.0.
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.
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\*'],
],
...
],
],
...
],
...
Comments