Read function logs
After you have deployed your function to STACKIT Functions, you can use the sfn functions logs command to view its log output.
This command allows you to retrieve and browse log output for a deployed function.
Usage
sfn functions logs [OPTIONS]
Options
| Flag | Type | Default | Description |
|---|---|---|---|
--page-size | integer | 20 | Number of log lines to display per page (max: 100). |
--stream | string | — | Filter by output stream: stdout or stderr. |
--from | string (ISO 8601) | — | Show only logs at or after this timestamp. |
--to | string (ISO 8601) | — | Show only logs at or before this timestamp. |
--project-id | string (uuid) | — | STACKIT project ID. Falls back to the workspace manifest. |
--function-id | string (uuid) | — | Function ID. Falls back to the workspace manifest. |
--path | path | current directory | Path to the workspace manifest file. |
Output Format
Each log line is printed as:
<timestamp> [<stream>] <message>
Example:
2026-04-18T10:00:00Z [stdout] Function invoked successfully
2026-04-18T10:00:01Z [stdout] Processing request took 42ms
2026-04-18T10:00:06Z [stderr] Unhandled exception: NullPointerException
Paging
Logs are fetched one page at a time. After each page you will be prompted:
-- Page 1 shown. Press [Enter] for next page, [q] to quit --
- Press Enter to fetch and display the next page.
- Press q then Enter to exit immediately.
Pagination stops automatically when there are no more logs to retrieve.
Examples
Show the first page of logs (default page size: 20)
sfn functions logs
Show 50 log lines per page
sfn functions logs --page-size 50
Show only stderr logs
sfn functions logs --stream stderr
Show logs from a specific time onwards
sfn functions logs --from 2026-04-18T10:00:00Z
Show logs within a time range
sfn functions logs --from 2026-04-18T10:00:00Z --to 2026-04-18T11:00:00Z
Combine stream filter with a time range
sfn functions logs --stream stderr --from 2026-04-18T10:00:00Z --to 2026-04-18T11:00:00Z
Use an explicit function and project ID
sfn functions logs \
--project-id a1b2c3d4-0000-0000-0000-000000000001 \
--function-id f1e2d3c4-0000-0000-0000-000000000002
Point to a manifest file in a different directory
sfn functions logs --path /path/to/my-function
Notes
-
Timestamps must be in ISO 8601 format, e.g.
2026-04-18T10:00:00Z. -
The
--fromand--toflags correspond to thestart_timeandend_timefilter fields in the underlying API. -
Piping output works as expected — the pager prompt is written to
stderr, sostdoutremains clean:sfn functions logs --stream stderr | grep "NullPointer"