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

Breadcrumb

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

function LoggerDataCollector::getContainerDeprecationLogs

1 call to LoggerDataCollector::getContainerDeprecationLogs()
LoggerDataCollector::lateCollect in vendor/symfony/http-kernel/DataCollector/LoggerDataCollector.php
Collects data as late as possible.

File

vendor/symfony/http-kernel/DataCollector/LoggerDataCollector.php, line 174

Class

LoggerDataCollector
@author Fabien Potencier <fabien@symfony.com>

Namespace

Symfony\Component\HttpKernel\DataCollector

Code

private function getContainerDeprecationLogs() : array {
    if (null === $this->containerPathPrefix || !is_file($file = $this->containerPathPrefix . 'Deprecations.log')) {
        return [];
    }
    if ('' === ($logContent = trim(file_get_contents($file)))) {
        return [];
    }
    $bootTime = filemtime($file);
    $logs = [];
    foreach (unserialize($logContent) as $log) {
        $log['context'] = [
            'exception' => new SilencedErrorContext($log['type'], $log['file'], $log['line'], $log['trace'], $log['count']),
        ];
        $log['timestamp'] = $bootTime;
        $log['timestamp_rfc3339'] = (new \DateTimeImmutable())->setTimestamp($bootTime)
            ->format(\DateTimeInterface::RFC3339_EXTENDED);
        $log['priority'] = 100;
        $log['priorityName'] = 'DEBUG';
        $log['channel'] = null;
        $log['scream'] = false;
        unset($log['type'], $log['file'], $log['line'], $log['trace'], $log['count']);
        $logs[] = $log;
    }
    return $logs;
}

API Navigation

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