Skip to content
Last updated

Logs and Monitoring

The CLI provides two modes for viewing function logs: historical (fetch recent requests) and streaming (live tail). Both use an interactive terminal UI.

Viewing Recent Logs

sinch functions logs [ID]

Fetches the 50 most recent requests and displays them in an interactive table. Navigate with arrow keys. Press Enter to expand request/response details and console output.

If you are inside the function directory (containing sinch.json), you can omit the ID.

Streaming Real-Time Logs

sinch functions logs [ID] --follow
sinch functions logs stream [ID]          # equivalent

Opens a live streaming connection. New requests appear as they arrive. Press Q or Ctrl+C to exit.

Log Viewer Controls

KeyAction
Up / DownNavigate rows
Enter or clickExpand request details
Esc or QClose detail view or quit
JCopy request as JSON to clipboard
CCopy request as cURL command to clipboard

Filtering Logs

sinch functions logs ID --level error       # errors only
sinch functions logs ID --search "timeout"  # text search
sinch functions logs ID --since 1h          # last hour
sinch functions logs ID --lines 200         # more entries
sinch functions logs ID --since 30m --level error  # combine

--since accepts s (seconds), m (minutes), h (hours), d (days).

Log Entry Details

Each expanded entry shows:

  • Request — HTTP method, URL, headers, and body sent to your function
  • Response — Status code, headers, and body your function returned
  • Console logsconsole.log/console.error output with timestamps

Function Status

sinch functions status [ID]               # current status
sinch functions status [ID] --follow      # poll every 3s for changes
sinch functions list                      # all functions in project
sinch functions list -i                   # interactive: select and take action
sinch functions status ID --json          # JSON output for scripting