/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
src/Illuminate/Log/Context/ContextLogProcessor.php
31 строка
818 B
mihaileu
[12.x] fixes https://github.com/laravel/octane/issues/1010 (#55008)
13 мар 2025, 17:48
Не верифицирован
13 мар 2025, 17:48
0e38972
Код
Авторство
О чём код?
<?php namespace Illuminate\Log\Context; use Illuminate\Container\Container; use Illuminate\Contracts\Log\ContextLogProcessor as ContextLogProcessorContract; use Illuminate\Log\Context\Repository as ContextRepository; use Monolog\LogRecord; class ContextLogProcessor implements ContextLogProcessorContract { /** * Add contextual data to the log's "extra" parameter. * * @param \Monolog\LogRecord $record * @return \Monolog\LogRecord */ public function __invoke(LogRecord $record): LogRecord { $app = Container::getInstance(); if (! $app->bound(ContextRepository::class)) { return $record; } return $record->with(extra: [ ...$record->extra, ...$app->get(ContextRepository::class)->all(), ]); } }