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

Breadcrumb

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

function Logger::record

1 call to Logger::record()
Logger::log in vendor/symfony/http-kernel/Log/Logger.php

File

vendor/symfony/http-kernel/Log/Logger.php, line 166

Class

Logger
Minimalist PSR-3 logger designed to write in stderr or any other stream.

Namespace

Symfony\Component\HttpKernel\Log

Code

private function record($level, $message, array $context) : void {
    $request = $this->requestStack
        ->getCurrentRequest();
    $key = $request ? spl_object_id($request) : '';
    $this->logs[$key][] = [
        'channel' => null,
        'context' => $context,
        'message' => $message,
        'priority' => self::PRIORITIES[$level],
        'priorityName' => $level,
        'timestamp' => time(),
        'timestamp_rfc3339' => date(\DATE_RFC3339_EXTENDED),
    ];
    $this->errorCount[$key] ??= 0;
    switch ($level) {
        case LogLevel::ERROR:
        case LogLevel::CRITICAL:
        case LogLevel::ALERT:
        case LogLevel::EMERGENCY:
            ++$this->errorCount[$key];
    }
}

API Navigation

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