You are here

public function LogsHttpLoggerInterface::registerEvent in Logs HTTP 8

Register an event in the cache.

Modules extending this service, in need for different data to be added to the event will likely override this method in the following way:


public function registerEvent($level, string $message, array $context = []) {
  $event = parent::registerEvent($level, $message, $context);

  // Update our custom value(s).
  $event['foo'] = 'bar';

  return $event;
}

Parameters

int $level: The severity level.

string $message: The message that contains the placeholders.

array $context: The context as passed from the main Logger.

Return value

array The event that was created, before it's added to the static cache.

1 method overrides LogsHttpLoggerInterface::registerEvent()
LogsHttpLogger::registerEvent in src/Logger/LogsHttpLogger.php
To prevent multiple registration of the same error, we check that identical events are not captured twice, thus reducing the final HTTP requests needed.

File

src/Logger/LogsHttpLoggerInterface.php, line 44

Class

LogsHttpLoggerInterface
Describes a Logs Http Logger instance.

Namespace

Drupal\logs_http\Logger

Code

public function registerEvent($level, string $message, array $context = []);