Access Logs with SFTP
Access your logs through SFTP on the Pantheon platform.
This section provides information on how to use SFTP to access your logs on Pantheon.
Logs are stored within application containers and database containers. Application containers house your site's codebase and files.
Click Connection Info in the Site Dashboard of the desired environment to get your SFTP connection information. You can review the connection information to gain an understanding of the pattern used for the hostnames: <env>.<site-uuid>@<type>.<env>.<site-uuid>.drush.in
| Type | Env | Site UUID |
|:------------ |:--------------------------------------- |:--------------------------------------------------------------------------------------------------------- |
| `appserver` | `dev`, `test`, `live`, `<multidev-env>` | ex. `c5c75825-5cd4-418e-8cb0-fb9aa1a7f671`, as found in `https://dashboard.pantheon.io/sites/<site-uuid>` |
| `dbserver` | | |
- You must [add an SSH key](/ssh-keys) in your Personal Settings if you want to enable password-less access and avoid authentication prompts.
Application Log Files
Follow the steps below to download your application log files.
Go to the Site Dashboard and open the desired environment (Multidev, Dev, Test, or Live).
Click Connection Info and copy the SFTP Command Line command.
Open a terminal window and paste the SFTP connection command.
Run the following SFTP command in the terminal:
get -r logs
You now have a local copy of the logs directory.
The directory structure will resemble the example below:
├── logs └──php └──newrelic.log └──php-error.log └──php-fpm-error.log └──php-slow.log └──nginx └──nginx-access.log └──nginx-error.log └──error.log
Note that this will only connect to one application container. If you have multiple application servers you will need to use the example script in Automate Log Downloads
Database Log Files
Follow the steps below to download your database log files.
Go to the Site Dashboard and open the desired environment (Multidev, Dev, Test, or Live).
Click Connection Info and copy the SFTP Command Line command.
Edit and execute the command by replacing
appserver
withdbserver
:From:
sftp -o Port=2222 dev.de305d54-75b4-431b-adb2-eb6b9e546014@appserver.dev.de305d54-75b4-431b-adb2-eb6b9e546014.drush.in
To:
sftp -o Port=2222 dev.de305d54-75b4-431b-adb2-eb6b9e546014@dbserver.dev.de305d54-75b4-431b-adb2-eb6b9e546014.drush.in
Run the following SFTP command:
get -r logs
You now have a local copy of the logs directory, which contains the following:
├── logs └──mysqld-slow-query.log └──mysqld.log