muster logs
Stream a service's logs, or print the last lines and exit.
Synopsis
Terminal
muster logs <service> [flags]Description
Streaming uses the first source that exists:
| Source | When |
|---|---|
just logs | The service's hook folder has a justfile with a logs recipe and just is installed. |
logs.sh | .muster/hooks/<service>/logs.sh is executable. |
| Latest deploy log | Neither exists: muster tails the newest <service>-*.log in .muster/logs/. |
With --tail, muster reads straight from the stack instead (kubectl, docker compose, docker, or the dev stack's log file) and falls back to the logs hook (stopped after 5 seconds, with MUSTER_LOGS_TAIL set) or the latest deploy log.
Flags
| Flag | Description |
|---|---|
--tail N, -n N | Print the last N lines and exit (--follow keeps streaming). |
--follow, -f | With --tail: keep streaming after the last N lines. |
--json | One NDJSON event per line: {"event":"log",…}. |
-h, --help | Show help. |
Examples
Terminal
muster logs api # stream api's logs
muster logs api --tail 200 # last 200 lines, then exit
muster logs api -n 50 -f # last 50 lines, then keep streaming
muster logs # pick a service (terminal only)Exit codes and JSON
--json prints log events and, with --tail, a final end event. When no log source exists it prints {"error":"no_logs"} on stderr and exits 1. See JSON API.