Skip to content

Logs and troubleshooting ​

Updated: 19 November 2026

Read logs ​

get_logs returns three kinds of logs:

sourceContent
runtime (default)stdout and stderr of your app
deployEvents of the deployments (pull, start, health check, rollback, …)
buildOutput of builds from source code

Filters: service, deployment_id, since and until (RFC 3339 or a duration such as 15m, 2h, 1d), contains (substring), level (error, warn, info, recognised by words such as error, fatal, panic), limit (up to 500, default 100). Without since the last 24 hours apply. Logs are kept for 7 days. With next_cursor the agent fetches older lines.

json
{ "project": "shop", "service": "api", "level": "error", "since": "30m" }

Logs are marked untrusted: they contain your app's output, which an agent should not treat as instructions. Values that look like secrets (tokens, passwords in URLs, API keys, JWTs, private keys) are blacked out, as are the values of your secrets; bucket name, region and endpoint from create_bucket (S3_BUCKET, S3_BUCKET_<NAME>, AWS_REGION, AWS_ENDPOINT_URL_S3) are not secret and stay readable. This is a best-effort filter, not a replacement for not logging secrets.

Limits: lines over 4 KB are shortened; a very large amount of output at once (over 1000 lines per report) is dropped and counted.

Follow logs ​

Every answer of get_logs contains follow_cursor. If the agent passes it as after on the next call, only the lines added since then come back, oldest first. With wait_s (up to 25) the call waits until the first new line is there instead of the agent polling. That way it follows the new instance's output during a deploy, alongside get_deployment with wait_s:

json
{ "project": "shop", "service": "api", "deployment_id": "dep_…", "after": "48213", "wait_s": 25 }

Then it calls again with the new follow_cursor until the deployment is finished. more: true means more than limit new lines are waiting; read on right away. With source: "build" it follows a running build this way, with source: "deploy" the events. The filters (service, deployment_id, contains, level) also apply while following. The node copies the app output every few seconds, so lines arrive in small batches.

What changed between revisions ​

For every deploy, list_deployments shows under changes which contract fields changed compared with the revision before, for example image, memory_mb, health or env.DATABASE_HOST (never values of environment variables, only the name). If the previous revision ran and the new one does not, that is usually the lead. To go back, use rollback_deployment (default: the last healthy revision), see rollback, stop and restart.

Diagnosis of a deployment ​

If a deployment fails, get_deployment contains a diagnosis with class, summary, evidence lines from the logs and suggested fixes.

ClassMeaningTypical fix
IMAGE_PULL_FAILEDImage not found or not publicCheck the reference, use a registry mirror
START_FAILEDContainer does not start (wrong command, wrong architecture)Check start_command, build linux/amd64
HEALTH_CHECK_FAILEDHealth check does not answer with 2xx/3xxListen on 0.0.0.0:$PORT, set health.path, raise grace_period_s
CRASHEDProcess exitsRead the logs, missing environment variables
CRASH_LOOPCrashes again after a restartas above
OOM_KILLEDMemory limit exceededRaise resources.memory_mb or lower memory use; files in /tmp and caches outside a volume also count as memory
BUILD_*, IMAGE_TOO_LARGEBuild failedsee build from source

If a new version fails, the previous one keeps serving. Your users keep getting the previous version in the meantime.

State of a project ​

get_project shows all services with their state (running, degraded, failed, stopped), URL and a list of issues, for example SERVICE_DEGRADED (the instance restarts after a crash, with a growing pause of at most 5 minutes; if it is not healthy again within 24 hours, the platform stops the service and reports CRASH_LOOP_STOPPED), SERVICE_AUTO_ROLLED_BACK (for 24 hours after an automatic rollback) or ACCOUNT_RESTRICTED (emergency stop active).

Metrics ​

get_metrics shows a service's memory and CPU for 15 minutes, 1 hour, 24 hours or 7 days: peak and average, the limit of its size and hints such as MEMORY_NEAR_LIMIT (choose a larger resources.memory_mb), MEMORY_OVERSIZED (a smaller size saves money) or CPU_BUSY. In the portal the same appears as a history under Projects → Usage. On top come the requests through the edge: count by status class, error rate (share of 5xx) and response time (average, p50, p95, p99) with the hints ERROR_RATE_HIGH and LATENCY_HIGH. Only numbers per service and minute are counted, no paths or visitors; details of single requests remain in the app's own logging.