Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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

FlagTypeDefaultDescription
--page-sizeinteger20Number of log lines to display per page (max: 100).
--streamstringFilter by output stream: stdout or stderr.
--fromstring (ISO 8601)Show only logs at or after this timestamp.
--tostring (ISO 8601)Show only logs at or before this timestamp.
--project-idstring (uuid)STACKIT project ID. Falls back to the workspace manifest.
--function-idstring (uuid)Function ID. Falls back to the workspace manifest.
--pathpathcurrent directoryPath 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 --from and --to flags correspond to the start_time and end_time filter fields in the underlying API.

  • Piping output works as expected — the pager prompt is written to stderr, so stdout remains clean:

    sfn functions logs --stream stderr | grep "NullPointer"