Hi All,
I am not able to use the logVars property of logging properly.
With this config:
[
'class' => 'common\components\log\ExceptionFileTarget',
'levels' => ['exception'],
'logFile' => '@runtime/logs/error.logstash.log',
'exportInterval' => 1,
],
I am getting an output which contains $_SERVER array, which is as per expectation
{
"timestamp":"2020-10-15T12:46:54+00:00",
"ip":"-",
"userId":"-",
"sessionId":"-",
"level":"exception",
"category":"customException",
"text":"[],
"$_SERVER":"["LANG" => "Eng, "LC_ALL" => "Some other value"]"
}
But with this config:
[
'class' => 'common\components\log\ExceptionFileTarget',
'levels' => ['exception'],
'logVars' => ['_SERVER.LC_ALL'],
'logFile' => '@runtime/logs/error.logstash.log',
'exportInterval' => 1,
],
I am not getting the $_SERVER variable at all.
I was expecting the output to be:
{
"timestamp":"2020-10-15T12:46:54+00:00",
"ip":"-",
"userId":"-",
"sessionId":"-",
"level":"exception",
"category":"customException",
"text":"[],
"$_SERVER":"["LC_ALL" => "Some other value"]"
}
Am I missing something? Why is the $_SERVER array completely missing from the log?