View and manage logs

Logs for Adobe Commerce on cloud infrastructure projects are useful for troubleshooting problems related to build and deploy hooks, cloud services, and the Adobe Commerce application.

You can view the logs from the file system, the Cloud Console, and the magento-cloud CLI.

  • File system—The /var/log system directory contains logs for all environments. The var/log/ directory contains app-specific logs unique to a particular environment. These directories are not shared between nodes in a cluster. In Pro Production and Staging environments, you must check the logs on each node.

  • Cloud Console—You can see build, deploy, and post-deploy log information in the environment messages list.

  • Cloud CLI—You can view local environment logs using the magento-cloud log command or remote environment logs using the magento-cloud ssh command.

Log locations

System logs are stored in the following locations:

  • Integration: /var/log/<log-name>.log
  • Pro Staging: /var/log/platform/<project-ID>_stg/<log-name>.log
  • Pro Production: /var/log/platform/<project-ID>/<log-name>.log

The value of <project-ID> depends on the project 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 yw1unoukjcawe.

Using that example, the deploy log is: /var/log/platform/yw1unoukjcawe_stg/deploy.log

View remote environment logs

Most logs include events that occur in the remote environment. For Pro, there are multiple nodes and each node has unique logs. Use the following to see a list of all hosts:

magento-cloud ssh -p <project-ID> -e <environment-ID> --all

Sample response:

To view a list of remote environment logs:

magento-cloud ssh -e <environment-ID> "ls var/log"

Example for Pro:

ssh "ls var/log | grep error"

To view a remote log:

magento-cloud ssh -e <environment-ID> "cat var/log/cron.log"

Example for Pro:

ssh "cat var/log/cron.log"
For Pro Staging and Production environments, automatic log rotation, compression, and removal are enabled for log files with a fixed file name. Each log file type has a rotating pattern and lifetime. Starter environments do not have log rotation. Full details of the environment’s log rotation and lifespan of compressed logs can be found in: /etc/logrotate.conf and /etc/logrotate.d/<various>. Log rotation cannot be configured in Pro Integration environments. For Pro Integration, you must implement a custom solution/script and configure your cron to run the script as needed.

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, verify, and locate the logs for a specific deployment. The following is a condensed example of log output that you can use for troubleshooting:

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:
    [2019-01-03 19:44:32] NOTICE: Post-deploy is complete.
When you configure your Cloud environment, you can set up log-based Slack and email notifications for build and deploy actions.

The following logs have a common location for all Cloud projects:

  • Deployment log: var/log/cloud.log
  • Last deployment error log: var/log/cloud.error.log
  • Debug log: var/log/debug.log
  • Exception log: var/log/exception.log
  • System log: var/log/system.log
  • Support log: var/log/support_report.log
  • Reports: var/report/

Though the cloud.log file contains feedback from each stage of the deployment process, logs created by the deploy hook are unique to each environment. The environment-specific deploy log is in the following directories:

  • Starter and Pro integration: /var/log/deploy.log
  • Pro Staging: /var/log/platform/<project-ID>_stg/deploy.log
  • Pro Production: /var/log/platform/<project-ID>/deploy.log

Deploy log

The log for each deployment concatenates to the specific deploy.log file. The following example prints the deploy log of the current environment in the terminal:

magento-cloud log -e <environment-ID> deploy

Sample response:

Reading log file'deploy.log'

[2023-04-24 18:58:03.080678] Launching command 'b'php ./vendor/bin/ece-tools run scenario/deploy.xml\n''.

[2023-04-24T18:58:04.129888+00:00] INFO: Starting scenario(s): scenario/deploy.xml (magento/ece-tools version: 2002.1.14, magento/magento2-base version: 2.4.6)
[2023-04-24T18:58:04.364714+00:00] NOTICE: Starting pre-deploy.
If you have issues with static content files in your application after deployment, such as missing custom theme files, increase the maximum expected execution time to 900 seconds or higher.

Error log

Error and warning messages generated during the deployment process are written to both the var/log/cloud.log and the var/log/cloud.error.log files. The Cloud error log file contains only errors and warnings from the latest deployment. An empty file indicates a successful deployment with no errors.

You can view the log file using the Cloud CLI SSH, or you can use ECE-Tools to show the errors with suggestions:

magento-cloud ssh -e <environment-ID> "./vendor/bin/ece-tools error:show"

Sample response:

errorCode: 1001
stage: build
step: validate-config
suggestion: Please run the following commands:
1. bin/magento module:enable --all
2. git add -f app/etc/config.php
3. git commit -m 'Adding config.php'
4. git push
title: File app/etc/config.php does not exist
type: warning

errorCode: 1006
stage: build
step: validate-config
suggestion: Your application does not have the "post_deploy" hook enabled.
  In order to minimize downtime, add the following to "":
      post_deploy: |
          php ./vendor/bin/ece-tools run scenario/post-deploy.xml
title: The configured state is not ideal
type: warning

Most error messages contain a description and suggested action. Use the Error message reference for ECE-Tools to look up the error code for further guidance. For further guidance, use the Adobe Commerce deployment troubleshooter.

Application logs

Similar to deploy logs, application logs are unique for each environment:

Log file
Starter and Pro Integration
Deploy log
Activity from the deploy hook.
Post-deploy log
Activity from the post-deploy hook.
Cron log
Output from cron jobs.
Nginx access log
On Nginx start, HTTP errors for missing directories and excluded file types.
Nginx error log
Startup messages useful for debugging configuration errors associated with Nginx.
PHP access log
Requests to the PHP service.

For Pro Staging and Production environments, the Deploy, Post-deploy, and Cron logs are available only on the first node in the cluster:

Log file
Pro Staging
Pro Production
Deploy log
First node only:
First node only:
Post-deploy log
First node only:
First node only:
Cron log
First node only:
First node only:
Nginx access log
Nginx error log
PHP access log

Archived log files

The application logs are compressed and archived once per day and kept for one year. The compressed logs are named using a unique ID that corresponds to the Number of Days Ago + 1. For example, on Pro production environments a PHP access log for 21 days in the past is stored and named as follows:


The archived log files are always stored in the directory where the original file was located before compression.

Deploy and Post-deploy log files are not rotated and archived. The entire deployment history is written within those log files.

Service logs

Because each service runs in a separate container, the service logs are not available in the integration environment. Adobe Commerce on cloud infrastructure provides access to the web server container in the integration environment only. The following service log locations are for the Pro Production and Staging environments:

  • Redis log: /var/log/platform/<project-ID>_stg/redis-server-<project-ID>_stg.log
  • Elasticsearch log: /var/log/elasticsearch/elasticsearch.log
  • Java garbage collection log: /var/log/elasticsearch/gc.log
  • Mail log: /var/log/mail.log
  • MySQL error log: /var/log/mysql/mysql-error.log
  • MySQL slow log: /var/log/mysql/mysql-slow.log
  • RabbitMQ log: /var/log/rabbitmq/rabbit@host1.log

Service logs are archived and saved for different periods of time, depending on the log type. For example, MySQL logs have the shortest lifetime—removed after seven days.

Log file locations in the scaled architecture depend on the node type. See Log locations in the Scaled architecture topic.

Log data for Pro Production and Staging

On Pro Production and Staging environments, use New Relic log management integrated with your project to manage aggregated log data from all logs associated with your Adobe Commerce on cloud infrastructure project.

The New Relic Logs application provides a centralized log management dashboard to troubleshoot and monitor Adobe Commerce on cloud infrastructure Production and Staging environments. The dashboard also provides access to log data for Fastly CDN, Image Optimization, and Web application firewall (WAF) services. See New Relic services.