Skip to content

App logs and server logs

An app’s log files contain log entries related to requests received by the app.

Server log files contain log entries related to the services running on the server as well as server events such as package installation.

View logs in the dashboard

To view server logs:

  1. Go to the Servers page in the dashboard and click on the name of the server.
  2. Click on Logs.
  3. Select the log file to view.

To view app logs:

  1. Go to the Apps page in the dashboard and click on the name of the app.
  2. Click on Logs.
  3. Select the log file to view.

View logs through SSH

To view app logs through SSH, you must be logged into a server as either the system user the app belongs to or as root.

To view server logs through SSH, you must be logged into a server as root.

To show the full contents of a log file, use cat:

Terminal window
cat path/to/log

To show the last 100 lines of a log file, use tail:

Terminal window
tail -n 100 path/to/log

To search a log file for a string of characters, use grep -F:

Terminal window
grep -F "string to search for" path/to/log

To search a log file using a regular expression, use grep:

Terminal window
grep "REGULAR_EXPRESSION" path/to/log

View compressed logs

Compressed log files have a .gz file extension.

To show the full contents of a compressed log file, use zcat:

Terminal window
zcat path/to/log.2.gz

To show the last 100 lines of a compressed log file, pipe the output of zcat to tail:

Terminal window
zcat path/to/log.2.gz | tail -n 100

To search a compressed log file for a string of characters, use zgrep -F:

Terminal window
zgrep -F "string to search for" path/to/log.2.gz

To search a compressed log file using a regular expression, use zgrep:

Terminal window
zgrep "REGULAR_EXPRESSION" path/to/log.2.gz

Log rotation

Log files are automatically rotated to limit disk space usage. To further reduce disk space usage, old log files are compressed.

When a log file is rotated:

  1. A new log file is created and subsequent log entries are written to the new log file.
  2. The suffix .1 is added to the previous log file which indicates it is the most recently rotated log file.
  3. Older rotated log files are renamed to .2, .3, etc.
  4. Older rotated log files are compressed and have a .gz suffix added to their file name.

App log files such as access logs are rotated daily. Rotated app log files are kept for one week before they are deleted.

For server logs such as system and service logs, the frequency of rotation and how long rotated logs are kept before deletion depends on the specific log file.

List of log files

The location and format of each log file is available in the log file’s documentation linked below.

ScopeLog fileDescription
AppNginx access logRequests received by Nginx.
AppNginx error logErrors related to Nginx requests.
AppApache access logRequests received by Apache.
AppApache error logErrors related to Apache requests.
AppPHP access logRequests received by PHP.
AppPHP error logErrors related to PHP requests.
AppPHP slow request logDetails of slow PHP script executions.
AppPHP mail logMail sent with PHP’s mail() function.
ServerSystem logSystem and service events.
ServerMySQL service logMySQL service events and errors.
ServerMySQL slow query logDetails of slow SQL query execution.
ServerNginx service logNginx service events and errors.
ServerApache service logApache service events and errors.
ServerPHP-FPM service logPHP-FPM service events and errors.
ServerSSH activity logSSH logins and failed login attempts.
ServerMail delivery logOutbound email delivery attempts.
ServerCron service logScheduled command executions.
ServerPackage manager logPackage installations and updates.