get_modal_app_logs
Fetch logs for a Modal app by name or ID. Supports filtering by time range, source, search text, and live-streaming with follow mode.
Instructions
Fetch logs for a Modal app by name or app ID (`modal app logs`).
By default the CLI fetches recent entries and exits. Pass `follow=True` to live-stream
(collected for up to `timeout_seconds`, then cut off as a snapshot). Use list_modal_apps
to discover the app name/ID.
Args:
app_identifier: App name (e.g. "my-app") or app ID (e.g. "ap-123456").
timeout_seconds: Max seconds to collect logs before returning. Defaults to 30.
env: Optional Modal environment to target.
since: Start of time range — ISO 8601 datetime or relative time like "2h", "30m", "1d".
until: End of time range (same formats as `since`).
tail: Show only the last N log entries.
search: Only include log lines matching this search text.
source: Filter by source: "stdout", "stderr", or "system".
follow: If True, live-stream logs until the app stops or the timeout is reached.
Returns:
A dictionary with the collected logs. `truncated` is True when the stream was still
active at the timeout (i.e. logs are a partial snapshot).Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_identifier | Yes | ||
| timeout_seconds | No | ||
| env | No | ||
| since | No | ||
| until | No | ||
| tail | No | ||
| search | No | ||
| source | No | ||
| follow | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |