get_modal_logs
Retrieve raw stdout, stderr, and system logs from Modal apps or containers. Use app/container IDs, time ranges, sources, and tail limits to pinpoint issues.
Instructions
Fetch logs for an app or container (`modal app logs` / `modal container logs`).
To find where something went wrong, prefer search_modal_logs — it returns matches
with surrounding context instead of a raw tail.
Covers the stdout/stderr/system streams ONLY. Crash events shown on the Modal
dashboard (e.g. "... exited with ...") are not log lines and never appear here.
Args:
identifier: App name/ID ("my-app", "ap-...") or container ID ("ta-...").
target: "auto" (default — "ta-..." is a container), "app", or "container".
timeout_seconds: Max seconds to collect. Default 30.
env: Modal environment. Apps only — container logs take no environment.
since / until: Time range, ISO 8601 or relative ("2h", "30m", "1d"). Max 35 days.
`since` without `tail` fetches EVERY entry in the range — pass `until` too
(or a `tail`) to bound the volume on a busy app.
tail: Only the last N entries (max 20000).
source: "stdout", "stderr", or "system".
timestamps: Prefix each line with its wall-clock timestamp.
follow: Live-stream until the app/container stops or the timeout hits.
Returns: {logs, truncated (still streaming at the timeout), output_capped (text
trimmed to fit context — narrow with tail/since/source)}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | ||
| tail | No | ||
| since | No | ||
| until | No | ||
| follow | No | ||
| source | No | ||
| target | No | auto | |
| identifier | Yes | ||
| timestamps | No | ||
| timeout_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |