muster logs

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:

SourceWhen
just logsThe 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 logNeither 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

FlagDescription
--tail N, -n NPrint the last N lines and exit (--follow keeps streaming).
--follow, -fWith --tail: keep streaming after the last N lines.
--jsonOne NDJSON event per line: {"event":"log",…}.
-h, --helpShow 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.