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:
- Go to the Servers page in the dashboard and click on the name of the server.
- Click on Logs.
- Select the log file to view.
To view app logs:
- Go to the Apps page in the dashboard and click on the name of the app.
- Click on Logs.
- 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
:
cat path/to/log
To show the last 100 lines of a log file, use tail
:
tail -n 100 path/to/log
To search a log file for a string of characters, use grep -F
:
grep -F "string to search for" path/to/log
To search a log file using a regular expression, use grep
:
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
:
zcat path/to/log.2.gz
To show the last 100 lines of a compressed log file, pipe the output of zcat
to tail
:
zcat path/to/log.2.gz | tail -n 100
To search a compressed log file for a string of characters, use zgrep -F
:
zgrep -F "string to search for" path/to/log.2.gz
To search a compressed log file using a regular expression, use zgrep
:
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:
- A new log file is created and subsequent log entries are written to the new log file.
- The suffix
.1
is added to the previous log file which indicates it is the most recently rotated log file. - Older rotated log files are renamed to
.2
,.3
, etc. - 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.
Scope | Log file | Description |
---|---|---|
App | Nginx access log | Requests received by Nginx. |
App | Nginx error log | Errors related to Nginx requests. |
App | Apache access log | Requests received by Apache. |
App | Apache error log | Errors related to Apache requests. |
App | PHP access log | Requests received by PHP. |
App | PHP error log | Errors related to PHP requests. |
App | PHP slow request log | Details of slow PHP script executions. |
App | PHP mail log | Mail sent with PHP’s mail() function. |
Server | System log | System and service events. |
Server | MySQL service log | MySQL service events and errors. |
Server | MySQL slow query log | Details of slow SQL query execution. |
Server | Nginx service log | Nginx service events and errors. |
Server | Apache service log | Apache service events and errors. |
Server | PHP-FPM service log | PHP-FPM service events and errors. |
Server | SSH activity log | SSH logins and failed login attempts. |
Server | Mail delivery log | Outbound email delivery attempts. |
Server | Cron service log | Scheduled command executions. |
Server | Package manager log | Package installations and updates. |