Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. EventLogger.php

function EventLogger::emit

Overrides EventLoggerInterface::emit

See also

https://github.com/open-telemetry/opentelemetry-specification/blob/v1.3…

File

vendor/open-telemetry/sdk/Logs/EventLogger.php, line 29

Class

EventLogger

Namespace

OpenTelemetry\SDK\Logs

Code

public function emit(string $name, mixed $body = null, ?int $timestamp = null, ?ContextInterface $context = null, ?Severity $severityNumber = null, iterable $attributes = []) : void {
    $logRecord = new LogRecord();
    $logRecord->setAttribute('event.name', $name);
    $logRecord->setAttributes($attributes);
    $logRecord->setAttribute('event.name', $name);
    $logRecord->setBody($body);
    $logRecord->setTimestamp($timestamp ?? $this->clock
        ->now());
    $logRecord->setContext($context ?? Context::getCurrent());
    $logRecord->setSeverityNumber($severityNumber ?? Severity::INFO);
    $this->logger
        ->emit($logRecord);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal