{
  "topic": "logs",
  "section": {
    "n": 5,
    "name": "Manage"
  },
  "title": "Logs",
  "covers": "Reading why a build failed or an app crashed",
  "summary": "The recent output of a server app. If the latest build failed, you get that build's log, which names the failing command. If it built but would not start, you get the output of the container that crashed, plus its exit code.",
  "done_when": "You found the cause, fixed it, redeployed, and the app is live.",
  "available": true,
  "who": {
    "connector": "read_app · action \"logs\"",
    "api": "GET https://ship.embarko.ai/apps/{app-name}/logs",
    "dashboard": "https://embarko.ai/app",
    "needs_human": null
  },
  "steps": {
    "connector": [
      "Call read_app { action: \"logs\", appName, stream: \"stderr\" }."
    ],
    "http_api": [
      "GET https://ship.embarko.ai/apps/{app-name}/logs?stream=stderr, with the token once the app is claimed."
    ]
  },
  "examples": [
    {
      "title": "Runtime logs",
      "command": "curl -sS 'https://ship.embarko.ai/apps/my-app/logs?stream=stderr'",
      "response_status": 200,
      "response": {
        "available": true,
        "source": "runtime",
        "stream": "stderr",
        "logs": "...tail of recent output...",
        "task": {
          "state": "dead",
          "failed": true,
          "restarts": 2,
          "exitCode": 1,
          "oomKilled": false,
          "events": [
            {
              "type": "Terminated",
              "message": "Exit Code: 1"
            }
          ]
        },
        "next": "The container exited with code 1 (it was restarted 2 times)."
      }
    }
  ],
  "limits": [
    "About the last 8KB; a snapshot, not a stream.",
    "source says what you got: \"runtime\" (the app's output) or \"build\" (the latest build's output). Add ?source=runtime or ?source=build to choose.",
    "After a failed build the reply has source \"build\" and the build output. After a deploy that built but crashed on start, it has that new container's output, not the previous version's.",
    "task has the container's exit code, OOM kill, restarts and events. Read it when logs is empty: an app can die before printing anything.",
    "If logs is empty and otherStreamHasOutput is true, ask for the other stream.",
    "When no runtime output exists, the build log comes back with runtime.reason saying why.",
    "Static sites have no logs (available: false).",
    "If the log names _litestream_seq or _litestream_lock as unknown or about to be dropped, the start command runs a schema sync against a database Embarko keeps those tables in: see the data topic. Do not add a force flag."
  ],
  "say_to_user": {
    "failed": "It didn't go live because of a problem in the code. I'm fixing it now."
  },
  "prerequisites": {
    "read_first": "https://embarko.ai/docs/prerequisites",
    "user": "The person is usually not a developer. They want to know if the app is live, not how.",
    "talk": "Reply in 1-3 short plain sentences: what happened, and what the person needs to do only if something is needed. Do not show commands, API names, tokens, headers or logs, or describe the steps you took, unless the person asks for technical details. If the person is clearly a developer (uses technical terms, asks what you ran), talk to them that way for the rest of the conversation. Never show a token. Never invent a link, name or code: use only what Embarko's replies, this guide or the person give you.",
    "route": "Connector first if it is in your tools, then the HTTP API, then the upload page as a last resort.",
    "domains": "ship.embarko.ai (API), embarko.ai (website), {app-name}.embarko.app (apps): all Embarko.",
    "requires": [
      {
        "topic": "status",
        "why": "Logs explain a failed or crashed status",
        "url": "https://embarko.ai/docs/status"
      }
    ]
  },
  "next": "Fix what the log names and redeploy. Do not paste the log to the person unless they ask. If the app's incidents show cause \"platform\", tell the person that outage is Embarko's side: nothing in the app changes for it (see alerts). Still fix and redeploy what the log names.",
  "related": [
    {
      "topic": "deploy",
      "why": "Redeploy the fix",
      "url": "https://embarko.ai/docs/deploy"
    },
    {
      "topic": "rollback",
      "why": "Put the last good version back meanwhile",
      "url": "https://embarko.ai/docs/rollback"
    },
    {
      "topic": "alerts",
      "why": "When it crashed, and whether it was the app or Embarko",
      "url": "https://embarko.ai/docs/alerts"
    },
    {
      "topic": "feedback",
      "why": "If the log points at Embarko, not the app",
      "url": "https://embarko.ai/docs/feedback"
    }
  ],
  "links": {
    "logs": "https://ship.embarko.ai/apps/{app-name}/logs",
    "incidents": "https://ship.embarko.ai/api/apps/{app-name}/incidents"
  },
  "url": "https://embarko.ai/docs/logs",
  "contents": "https://embarko.ai/docs",
  "version": "2026-11-24"
}