There are two kinds of logs: the server's, on the Logs page, and each site's, on its Logs tab. The panel shows the last lines; press Refresh to read them again.
The server's logs
Open Logs from the menu. The tabs are:
| Tab | What it holds | Where it is |
|---|---|---|
| Nginx access | nginx's general access log. | /var/log/nginx/access.log |
| Nginx error | nginx's errors. | /var/log/nginx/error.log |
| PHP-FPM | The journal of every site's PHP processes. | journal, cloudground-php-*.service |
| MariaDB | The database's errors. | /var/log/mysql/error.log |
| API | The panel. | journal, cloudground-api.service |
| Agent | The agent that does the root work. | journal, cloudground-agent.service |
Operators do not see this page: the server's logs concern every site.
A site's logs
Open the site and go to the Logs tab. Its tabs are Access, Errors and PHP errors, with
the last 200 lines. On disk they are in /var/log/cloudground/<domain>/:
| Tab | File |
|---|---|
| Access | access.log |
| Errors | error.log |
| PHP errors | php-error.log |
A file that does not exist yet reads (log is empty or not created yet).
On the server
As root, the logs in the journal are read with journalctl:
journalctl -u cloudground-api -u cloudground-agent -n 100
From the API
GET /api/logs?source=<source>&lines=<n> reads a server log; source is nginx-access,
nginx-error, php-error, mariadb, api or agent, and lines is 1 to 2000 (200 when absent).
GET /api/sites/<id>/logs?source=<kind> reads a site log; source is access, error or php.
A line longer than 8 KiB is cut.
Next step
Do not wait to read a log to notice a problem: set up alerts and notifications.