apus logs

Tail Gateway file logs over RPC. Works in remote mode.

Options

Polling intervals larger than 2,147,000,000 ms are capped at that value to avoid timer overflow.

Shared Gateway RPC options

Passing --url skips auto-applied config credentials; include --token explicitly if the target Gateway requires auth.

--port requires an integer from 1 to 65535; empty or whitespace-only values are invalid. Omit the option to use the configured or environment target.

Examples

apus logs
apus logs --follow
apus --dev logs --follow
apus --profile work logs --follow
apus logs --follow --interval 2000
apus logs --limit 500 --max-bytes 500000
apus logs --json
apus logs --plain
apus logs --no-color
apus logs --utc
apus logs --follow --local-time
apus logs --port 19083 --json
apus logs --url ws://127.0.0.1:18789 --token "$APUS_GATEWAY_TOKEN"

The selected root profile matches the Gateway's rolling file: the default profile uses apus-YYYY-MM-DD.log, while named profiles use apus-<profile>-YYYY-MM-DD.log (for example, apus-dev-YYYY-MM-DD.log).

Fallback and recovery behavior

In --json mode, invalid --port, --limit, --interval, or --max-bytes values and conflicting --url/--port options produce the standard CLI failure envelope on stdout: {"ok":false,"error":{"type":"cli_error","message":"..."}}. Terminal log-fetch failures instead emit {"type":"error",...} on stderr. Both exit with status 1.

In text mode, terminal log-fetch failures print the redacted error reason, selected Gateway connection details, and a doctor hint on stderr. A received RPC rejection is shown as the error, rather than reported as a Gateway reachability failure.

In JSON mode, terminal log-fetch errors use the same redacted failure reason for message and error, including RPC rejections, timeouts, disconnects, and invalid response payloads. The record retains connection details and a doctor hint on stderr; the command still exits with status 1.

Related