/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/Logger/Handler/System.php
68 строк
1 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 17:47
22 окт 2025, 17:47
1b769b7
Код
Авторство
О чём код?
<?php /** * Copyright 2014 Adobe * All Rights Reserved. */ declare(strict_types=1); namespace Magento\Framework\Logger\Handler; use Exception; use Magento\Framework\Filesystem\DriverInterface; use Magento\Framework\Logger\Handler\Exception as ExceptionHandler; use Monolog\Logger; use Monolog\LogRecord; /** * System stream handler */ class System extends Base { /** * @var string */ protected $fileName = '/var/log/system.log'; /** * @var int */ protected $loggerType = Logger::INFO; /** * @var ExceptionHandler */ protected $exceptionHandler; /** * @param DriverInterface $filesystem * @param ExceptionHandler $exceptionHandler * @param string|null $filePath * @throws Exception */ public function __construct( DriverInterface $filesystem, ExceptionHandler $exceptionHandler, ?string $filePath = null ) { $this->exceptionHandler = $exceptionHandler; parent::__construct($filesystem, $filePath); } /** * Writes formatted record through the handler * * @param array $record The record metadata * @return void */ public function write(LogRecord $record): void { if (isset($record['context']['exception'])) { $this->exceptionHandler->handle($record); return; } $record['formatted'] = $this->getFormatter()->format($record); parent::write($record); } }