var/log/
Pro projects have a three-node structure and each node contains logs with specific information for that node.
Logs in var/log on Staging and Production: separate log for every node
Logs in the var/log/ directory are not shared between nodes of the enterprise server cluster; each server has its own log. We recommend checking logs on every node for complete reporting.
Log locations (directories) for Starter plan
- Build log => var/log/cloud.log
- Debug log => var/log/debug.log
- Exception log => var/log/exception.log
- Report logs (reports) => var/reports
- Support report log => var/log/support_report.log
- Deployment log => /var/log/deploy.log
- Cron log => /var/log/cron.log
- Nginx access log => /var/log/access.log
- Nginx error log => /var/log/error.log
- PHP access log => /var/log/php.access.log
- PHP FPM log => /var/log/app.log
- Redis log => No access
- Elasticseach log => No access
- Mail log => No access
- MySQL error log => No access
- MySQL slow log => No access
- RabbitMQ log => No access
- Solr log => No access
- Syslog => No access
Log locations (directories) for Pro plan: Integration, Staging, Production
Integration => Staging => Production
- Build log => var/log/cloud.log
- Debug log => var/log/debug.log
- Exception log => var/log/exception.log
- Report logs (reports) => var/reports
- Support report log => var/log/support_report.log
- Deployment log => /var/log/deploy.log => /var/log/platform/{project_id}_stg/deploy.log => /var/log/platform/{project_id}/deploy.log
- Cron log => /var/log/cron.log => /var/log/platform/{project_id}_stg/cron.log => var/log/platform/{project_id}/cron.log
- Nginx access log => /var/log/access.log => /var/log/platform/{project_id}_stg/access.log => /var/log/platform/{project_id}/access.log
- Nginx error log => /var/log/error.log => /var/log/platform/{project_id}_stg/error.log => /var/log/platform/{project_id}/error.log
- PHP access log => /var/log/php.access.log => /var/log/platform/{project_id}_stg/php.access.log => /var/log/platform/{project_id}/php.access.log
- PHP FPM log => /var/log/app.log => /var/log/platform/{project_id}_stg/php5-fpm.log => /var/log/platform/{project_id}/php5-fpm.log
- Redis log => No access => /var/log/platform/{project_id}_stg/redis-server-{project_id}_stg.log => /var/log/platform/{project_id}/redis-server-{project_id}.log
- Elasticseach log => No access => /var/log/elasticsearch/elasticsearch.log
- Mail log => No access => /var/log/mail.log
- MySQL error log => No access => /var/log/mysql/mysql-error.log
- MySQL slow log => No access => /var/log/mysql/mysql-slow.log
- RabbitMQ log => No access => /var/log/rabbitmq/[email protected]
- Solr log => No access => /var/log/platform/solr.log
- Syslog => No access
- Add xdebug extension
For Pro Staging and Production, you need to update this file and enter a Support ticket to have it enabled
#.magento.app.yaml
runtime:
extensions:
- mcrypt
- redis
- xsl
- json
- xdebug
- Optionally, modify the timeout. A default timeout of 300 seconds (5 minutes)
web:
commands:
start: |
cat /etc/php/7.0/fpm/php-fpm.conf | sed -e 's/request_terminate_timeout.*//g' > /tmp/php-fpm.conf
/usr/sbin/php-fpm7.0 -y /tmp/php-fpm.conf
-
Configure PhpStorm
-
Set up port forwarding
ssh -R 9000:localhost:9000 <ssh url>
Pro staging and production
Set up the tunnels, this will connect to localhost on port 9000
Three tunnels are needed because we never know which host the request will hit. The rm commands are necessary to clean up from past sessions.
ssh [email protected] 'rm /run/platform/USERNAME/xdebug.sock'
ssh -R /run/platform/USERNAME/xdebug.sock:localhost:9000 -N [email protected]&
ssh [email protected] 'rm /run/platform/USERNAME/xdebug.sock'
ssh -R /run/platform/USERNAME/xdebug.sock:localhost:9000 -N [email protected]&
ssh [email protected] 'rm /run/platform/USERNAME/xdebug.sock'
ssh -R /run/platform/USERNAME/xdebug.sock:localhost:9000 -N [email protected]&
Next to enable remote debugging, visit the site in the browser, add ?XDEBUG_SESSION_START=KEY to the url, where KEY is the key set in the yaml file. This will set the cookie causing browser requests to trigger xdebug. ?XDEBUG_SESSION_STOP=KEY can be used to remove the cookie, stopping the session.
XDEBUG_SESSION_START passed via POST requests is not supported, the cookie must first be set either manually or via a GET request.
CLI ssh 1.ent-{project_id}@ssh.eu.magentosite.cloud
rm /run/platform/{project_id}_stg/xdebug.sock
ssh -R /run/platform/{project_id}_stg/xdebug.sock:localhost:9000 -N 1.ent-{project_id}@ssh.eu.magentosite.cloud
configure phpstorm https://devdocs.magento.com/guides/v2.2/cloud/howtos/debug.html#phpstorm
export XDEBUG_CONFIG='PHPSTORM' export PHP_IDE_CONFIG="serverName=magento-cloud-staging"
php -c /etc/platform/{project_id}_stg/php.xdebug.ini ./bin/magento
Sometimes we provide a custom patch to address a specific issue. Also, third-party extension developers can provide a custom patch. Copy the custom patch to the
m2-hotfixes/
directory and test it on your local workstation.
php ./vendor/bin/ece-tools build:generate
will apply custom patches during build phase
- Process\Build\ApplyPatches
git apply
patches fromm2-hotfixes/*.patch
Documentation: