Skip to content

Commit

Permalink
ENGCOM-2371: Log when Magento is in maintenance mode #16840
Browse files Browse the repository at this point in the history
 - Merge Pull Request #16840 from Ethan3600/magento2:hotfix/log-maintenance-mode
 - Merged commits:
   1. ef616ce
   2. ac57387
   3. 19c3f3a
   4. 8d57d04
  • Loading branch information
magento-engcom-team committed Jul 19, 2018
2 parents 21f33bc + 8d57d04 commit d6a9205
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit d6a9205

Please sign in to comment.