Skip to content

Commit 081e7ad

Browse files
author
Stanislav Idolov
authored
ENGCOM-2371: Log when Magento is in maintenance mode #16840
2 parents 1cbb5bc + d6a9205 commit 081e7ad

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/internal/Magento/Framework/App/Bootstrap.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Magento\Framework\Autoload\Populator;
1313
use Magento\Framework\Config\File\ConfigFilePool;
1414
use Magento\Framework\Filesystem\DriverPool;
15+
use Psr\Log\LoggerInterface;
1516

1617
/**
1718
* A bootstrap of Magento application
@@ -258,6 +259,7 @@ public function run(AppInterface $application)
258259
\Magento\Framework\Profiler::stop('magento');
259260
} catch (\Exception $e) {
260261
\Magento\Framework\Profiler::stop('magento');
262+
$this->objectManager->get(LoggerInterface::class)->error($e->getMessage());
261263
if (!$application->catchException($this, $e)) {
262264
throw $e;
263265
}
@@ -423,7 +425,7 @@ protected function terminate(\Exception $e)
423425
if (!$this->objectManager) {
424426
throw new \DomainException();
425427
}
426-
$this->objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e);
428+
$this->objectManager->get(LoggerInterface::class)->critical($e);
427429
} catch (\Exception $e) {
428430
$message .= "Could not write error message to log. Please use developer mode to see the message.\n";
429431
}

0 commit comments

Comments
 (0)