/**
* Prepares extra data to pass to a backend
* Those include RUID, EUID, AccountID, environment etc.
*
* @return array Prepared extra data for logging
*/
protected function getCommonData()
{
$data = empty($this->user) ? ["login" => $this->systemTask ? '_' . $this->systemTask : 'guest', "ruid" => null, "euid" => null, "env_id" => $this->envId ?: 0, "account_id" => $this->accountId] : ["login" => $this->user->getEmail(), "ruid" => $this->realUserId ?: $this->user->id, "euid" => $this->user->id, "env_id" => $this->envId ?: 0, "account_id" => empty($this->accountId) ? $this->user->getAccountId() : $this->accountId];
$data['ip_address'] = $this->ipAddress;
$data['timestamp'] = AuditLogger::getTimestamp();
$data['request_type'] = $this->requestType;
return $data;
}