Logs are useful for troubleshooting problems related to Magento Commerce Cloud build and deploy hooks.
Magento-specific logs are in the
<magento-root-dir>/var/ directory. See Magento Logging in the Configuration guide.
You can set up log-based Slack and email notifications when configuring your Cloud environment.
There are three ways to view logs: file system, project web UI, or magento-cloud CLI.
- Log directories—The
var/logdirectory contains logs for all environments. You must use an SSH connection to access the
var/logdirectory in the remote server environment.
- Project web UI—You can see build and post-deploy log information in the environment messages list.
- Magento Cloud CLI—You can view logs using the
You use the
magento-cloud log command to quickly view a specific log. If you do not specify a log name, you can choose a log from the response list.
1 magento-cloud log
1 2 3 4 5 6 7 8 9 Enter a number to choose a log:  access  app  cron  deploy  error  php.access  post-deploy >
By default, the command displays the log from the Integration environment. For the Pro Staging logs, you need to specify the log location using the project ID.
1 magento-cloud log platform/<project_id>_stg/<log>
Build and Deploy logs
After pushing changes to your environment, you can review the logging from each hook in the
var/log/cloud.log file. The log contains start and stop messages for each hook. In the following example, the messages are “
Starting post-deploy.” and “
Post-deploy is complete.”
Check the timestamps on log entries to verify and locate the logs for a specific deployment. The following is a condensed example of log output that you can use for troubleshooting:
1 2 3 4 5 6 7 8 9 10 11 12 Re-deploying environment project-integration-ID Executing post deploy hook for service `mymagento` [2019-01-03 19:44:11] NOTICE: Starting post-deploy. [2019-01-03 19:44:11] INFO: Validating configuration [2019-01-03 19:44:11] INFO: End of validation [2019-01-03 19:44:11] INFO: Enable cron [2019-01-03 19:44:11] INFO: Create backup of important files. [2019-01-03 19:44:11] INFO: Backup /app/app/etc/env.php.bak for /app/app/etc/env.php was created. [2019-01-03 19:44:11] INFO: Backup /app/app/etc/config.php.bak for /app/app/etc/config.php was created. [2019-01-03 19:44:11] INFO: php ./bin/magento cache:flush --ansi --no-interaction [2019-01-03 19:44:32] INFO: Warming up failed: http://integration-id-project.us.magentosite.cloud/ [2019-01-03 19:44:32] NOTICE: Post-deploy is complete.
The following logs have a common location for all Cloud projects:
- Build log:
- Debug log:
- Exception log:
- Support report log:
Logs from the deploy hook are unique for each environment. The deploy log is in the following directories:
- Starter and Pro Integration:
- Pro Staging:
- Pro Production:
The value of
<project_id> depends on the project ID and whether the environment is Staging or Production. For example, with a project ID of
yw1unoukjcawe, the Staging environment user is
yw1unoukjcawe_stg and the Production environment user is
Using that example, the deploy log is:
The log for each deployment concatenates to the specific
To view the deploy log:
1 magento-cloud log deploy
1 2 3 4 5 6 7 8 9 Reading log file project-integration-IDemail@example.com:/var/log/'deploy.log' ================ Error Output: ================ sh: 1: kill: No such process [2019-09-09 09:00:00] NOTICE: Validating configuration ...
To view a deploy log from the Staging environment:
1 magento-cloud log platform/<project_id>_stg/deploy
Similar to deploy logs, application logs are unique for each environment. The following table lists application log locations on each environment:
|Log file||Starter and Pro Integration||Pro Staging||Pro Production|
|Nginx access log||
|Nginx error log||
|PHP access log||
|PHP FPM log||
Because each service runs in a separate container, the service logs are not available in the Integration environment. Magento Commerce Cloud provides access to the web server container in the Integration environment only. The following service log locations are for the Pro Staging and Production environments:
- Redis log:
- Elasticseach log:
- Mail log:
- MySQL error log:
- MySQL slow log:
- RabbitMQ log: