protected function getContextMessage()
    {
        $context = $this->context;

        if (($this->logUser === true) && ($user = \Yii::$app->get('user', false)) !== null) {
            /** @var \yii\web\User $user */
            $context['userId'] = $user->getId();
        }

        foreach ($this->logVars as $name) {
            if (empty($GLOBALS[$name]) === false) {
                $context[$name] = & $GLOBALS[$name];
            }
        }

        return $context;
    }