Get Site Logs
get_site_logsRead a site's application, Nginx access, or Nginx error logs to diagnose failures; returns the end of the log by default, with optional tail length for more lines.
Instructions
Tail a site's logs: the Laravel/application log, or the Nginx access or error log. The first place to look when a site is throwing errors. Returns the END of the log by default (that is where failures are) — raise tail_lines for more. Requires the server:manage-logs scope, whose only write power is clearing logs. Note that Forge reads logs from the server over SSH at request time, so a server whose Forge access has been revoked returns an SSH error instead of a log.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | Yes | Site id from list_sites. | |
| type | Yes | Which log to read. | |
| server | Yes | Server id the site is on. | |
| tail_lines | No | Return only the last N lines, where failures appear (default 200). Output is additionally capped by character count, so a very long single line cannot flood the response. | |
| organization | No | Organisation slug. Optional when the server has a default configured. |