-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Log when Magento is in maintenance mode #16840
Log when Magento is in maintenance mode #16840
Conversation
Let's not play guessing games why we're getting a 500 errors...
Hi @Ethan3600. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
Please sign the CLA. |
Signed |
@@ -259,7 +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); | |||
$this->objectManager->get(LoggerInterface::class)->error($e->getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Hi @Ethan3600. Thank you for your contribution. Please, consider to port this solution to 2.3 release line. |
Description
Logging when Magento is in maintenance mode.
Not sure if I'm the only one that fell for this, but I've (embarrassingly) spent hours trying figuring out why Magento was throwing a 500 error; only to find that it was just in maintenance mode...
Logging this will save developers some time, and eliminate some of the guess work involved with troubleshooting obscure errors.
This is usually applicable when a deployment goes a little haywire.
As a "side-affect" we'd also be logging errors coming from the launch process, which I don't think is that much of an issue.
Manual testing scenarios
tail -f var/log/system.log
Contribution checklist