Skip to content
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

Merged

Conversation

Ethan3600
Copy link
Contributor

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.

==> var/log/system.log <==
[2018-07-15 19:38:12] main.ERROR: Unable to proceed: the maintenance mode is enabled.

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

  1. Enable maintenance mode
  2. Run tail -f var/log/system.log
  3. Expect "Unable to proceed: the maintenance mode is enabled"

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

Let's not play guessing games why we're getting a 500 errors...
@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Jul 15, 2018

CLA assistant check
All committers have signed the CLA.

@magento-engcom-team
Copy link
Contributor

Hi @Ethan3600. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me {$VERSION} instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@DanielRuf
Copy link
Contributor

Please sign the CLA.

@Ethan3600
Copy link
Contributor Author

Signed

@VladimirZaets VladimirZaets self-assigned this Jul 15, 2018
@@ -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());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@magento-engcom-team magento-engcom-team merged commit 8d57d04 into magento:2.2-develop Jul 23, 2018
@magento-engcom-team
Copy link
Contributor

Hi @Ethan3600. Thank you for your contribution.
We will aim to release these changes as part of 2.2.6.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants