Skip to content

Log when Magento is in maintenance mode #16840

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/internal/Magento/Framework/App/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Magento\Framework\Autoload\Populator;
use Magento\Framework\Config\File\ConfigFilePool;
use Magento\Framework\Filesystem\DriverPool;
use Psr\Log\LoggerInterface;

/**
* A bootstrap of Magento application
Expand Down Expand Up @@ -258,6 +259,7 @@ public function run(AppInterface $application)
\Magento\Framework\Profiler::stop('magento');
} catch (\Exception $e) {
\Magento\Framework\Profiler::stop('magento');
$this->objectManager->get(LoggerInterface::class)->error($e->getMessage());
if (!$application->catchException($this, $e)) {
throw $e;
}
Expand Down Expand Up @@ -423,7 +425,7 @@ protected function terminate(\Exception $e)
if (!$this->objectManager) {
throw new \DomainException();
}
$this->objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e);
$this->objectManager->get(LoggerInterface::class)->critical($e);
} catch (\Exception $e) {
$message .= "Could not write error message to log. Please use developer mode to see the message.\n";
}
Expand Down