Get server logs
get_logsRead the latest log tails from a server: one entry per log file that a project's processes have written (each long-running process appends to .server4agent/.log in its project folder). Read live from the server at the moment you call. If the server does not answer in time (starting, restarting, or paused), you get the tails saved earlier with stale: true and a note saying how old they are. An app keeps the same log file across restarts. Pass project_id to get only that project's logs. Use this to debug a crashing app or check what a background process is doing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | No | Max tail lines per file (default 200, max 1000). | |
| server_id | Yes | The server's id, as returned by create_server or list_servers. | |
| project_id | No | Optional. Only log files from this project's workspace folder. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | Why the tails are stale and how old they are. null when they are live. | |
| files | Yes | One entry per log file. | |
| stale | Yes | false when the tails were read from the server at this call. true when it could not be read, so they are the copy saved at updated_at, which can be days old. | |
| updated_at | No | When the log tails were read. null when the server has reported none yet. |