Answer the question
In order to leave comments, you need to log in
How to get rid of $_SERVER in Yii2 logs?
Log settings
'log' => [
'traceLevel' => 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['info'],
'categories' => ['binary'],
'logFile' => '@console/runtime/binary/credits_exchange_success.log',
],
[
'class' => 'yii\log\FileTarget',
'levels' => ['error'],
'categories' => ['binary'],
'logFile' => '@console/runtime/binary/credits_exchange_error.log',
],
],
],
Yii::getLogger()->log('error message', Logger::LEVEL_ERROR, 'binary');
Answer the question
In order to leave comments, you need to log in
Everything is easily customizable.
https://github.com/yiisoft/yii2/blob/master/framew...
...
[
'class' => 'yii\log\FileTarget',
'levels' => ['info'],
'categories' => ['binary'],
'logVars' => ['_GET', '_POST', '_FILES', '_COOKIE', '_SESSION'],
'logFile' => '@console/runtime/binary/credits_exchange_success.log',
],
...
Spiker hinted correctly, rewriting FileTarget for this is stupid... correct the config by adding
'logVars' => []
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
'logVars' => [],
],
],
],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question