logs
1ctl logs gives you two ways to read your application’s output: a snapshot of recent lines stored in the database, and a live stream proxied directly from the Kubernetes pod log stream via WebSocket.
you → 1ctl logs → GET /v1/cli/loki/logs/{id} → database snapshotyou → 1ctl logs stream → WebSocket /v1/pods/stream/logs/{ns}/{app} → live pod streamStored logs are available immediately after a deployment starts and persist for as long as the deployment exists. The live stream requires at least one running pod — if the deployment is scaled to zero or still pending, the WebSocket connection will close with an error.
Implemented. 1ctl logs supports --tail. 1ctl logs stream does not support --tail; use --batch-size to tune streaming batch size.
Commands
Section titled “Commands”1ctl logs
Section titled “1ctl logs”1ctl logs [--deployment-id <id>] [--config <cfg>] [-n/--tail <lines>]Fetches recent log lines from the database snapshot. Satusky writes pod output into the deployment_logs table in PostgreSQL on a rolling basis, so this command returns quickly without a live connection to the cluster.
Flags
| Flag | Short | Default | Description |
|---|---|---|---|
--deployment-id <id> | satusky.toml | Deployment to fetch logs for. If omitted, resolved from satusky.toml in the current directory. | |
--tail <lines> | -n | 100 | Number of lines to return, counted from the most recent. |
--config <name> | satusky.toml | Named config file to use (e.g. staging resolves to satusky.staging.toml). |
Under the hood:
1ctlresolves the deployment ID from the flag or fromsatusky.tomlGET /v1/cli/loki/logs/{deploymentID}— the?tail=Nquery parameter controls how many lines the API reads from the stored log source- The API returns the lines as a JSON array;
1ctlprints them to stdout in order
Examples
# View the last 100 lines for the project in the current directory1ctl logs
# Limit to the last 50 lines1ctl logs --tail 50
# Fetch logs for a specific deployment by ID1ctl logs --deployment-id cb7db400-392f-465b-8c05-829d1008f3ed --tail 20
# Use a named environment config1ctl logs --config staging1ctl logs stream
Section titled “1ctl logs stream”1ctl logs stream [--deployment-id <id>] [-n/--namespace <ns>] [-a/--app <label>] [--batch-size <n>] [--config <cfg>]Opens a persistent WebSocket connection to the Satusky backend, which proxies the Kubernetes pod log stream in real time. The connection stays open until you press Ctrl+C or the server closes the stream.
Flags
| Flag | Short | Default | Description |
|---|---|---|---|
--deployment-id <id> | satusky.toml | Deployment to stream logs for. If omitted, resolved from satusky.toml. | |
--namespace <ns> | -n | active org namespace | Kubernetes namespace to target. Rarely needed — your org namespace is used automatically. |
--app <label> | -a | app name from satusky.toml | Kubernetes app label to filter pods by. |
--batch-size <n> | 100 | Number of log lines the server sends per WebSocket message. Lower values reduce buffering latency. | |
--config <name> | satusky.toml | Named config file to use. |
Under the hood:
1ctlopens a WebSocket to/v1/pods/stream/logs/{namespace}/{appLabel}and sendsx-satusky-api-keyin the upgrade headers- The backend identifies the matching pods in the target namespace and opens a multiplexed Kubernetes log stream against each running pod
- Log lines are batched (controlled by
--batch-size) and sent as WebSocket frames to the CLI 1ctlreads each frame and writes the lines to stdout as they arrive- If Loki is configured in your cluster, the backend also indexes lines there for longer-term retention — the stream itself is unaffected either way
Examples
# Stream live logs for the project in the current directory1ctl logs stream
# Stream logs for a specific deployment1ctl logs stream --deployment-id cb7db400-392f-465b-8c05-829d1008f3ed
# Reduce batch size for lower-latency output1ctl logs stream --batch-size 10
# Stream from a staging config1ctl logs stream --config stagingLog retention
Section titled “Log retention”Stored logs (the 1ctl logs snapshot) reflect what was most recently written to the deployment_logs table. This is a rolling buffer — older lines are evicted as new ones arrive. For longer retention, configure Loki in your cluster settings; when Loki is enabled, every line ingested by the streaming backend is also indexed and queryable outside 1ctl.
Deployment ID resolution
Section titled “Deployment ID resolution”Both subcommands resolve the target deployment the same way (first match wins):
--deployment-idflagdeployment_idfield insatusky.toml(or the file named by--config)- Error — no deployment can be identified
v1 target
Section titled “v1 target”The CLI should print how it resolved the target when ambiguity is possible:
Streaming logs for orgv1-80c8588b/diagnosis-botResolved from deployment ID cb7db400-392f-465b-8c05-829d1008f3edThis matters in CI and multi-profile workflows where the same app name can exist in more than one namespace or API profile.