You are here

protected function LagoonLogsLogger::transformDataForProcessor in Lagoon Logs 8

Parameters

$level:

$message:

array $context:

$base_url:

Return value

array

1 call to LagoonLogsLogger::transformDataForProcessor()
LagoonLogsLogger::log in src/Logger/LagoonLogsLogger.php
Logs with an arbitrary level.

File

src/Logger/LagoonLogsLogger.php, line 80

Class

LagoonLogsLogger

Namespace

Drupal\lagoon_logs\Logger

Code

protected function transformDataForProcessor($level, $message, array $context, $base_url) {
  $processorData = [
    "extra" => [],
  ];
  $processorData['message'] = $message;
  $processorData['extra']['ip'] = $context['ip'];
  $processorData['extra']['request_uri'] = $context['request_uri'];
  $processorData['level'] = $this
    ->mapRFCtoMonologLevels($level);
  $processorData['extra']['uid'] = $context['uid'];
  $processorData['extra']['link'] = strip_tags($context['link']);
  $processorData['extra']['channel'] = $context['channel'];
  $processorData['extra']['application'] = self::LAGOON_LOGS_DEFAULT_IDENTIFIER;
  return $processorData;
}