Every resource that produces logs — jobs, multi-machine jobs, deployments, and
sandboxes — has its own logs command, and they share the same flags. Use
them to tail a run from a terminal, search a finished run for an error, or watch
only the lines that matter.
$ pip install lightning-sdk -U
$ lightning login
$ lightning config set teamspace owner/teamspaceEvery example below also accepts --teamspace owner/teamspace explicitly; pass
it when you work across several teamspaces or run in CI.
One command per resource, addressed by name (or id for sandboxes):
$ lightning job logs sdk-tutorial-job
$ lightning mmt logs sdk-tutorial-mmt
$ lightning deployment logs sdk-tutorial-api
$ lightning sandbox logs sbx-42A multi-machine job and a multi-replica deployment merge every machine or replica
into one timeline, and each line is labelled with where it came from. To read a
single machine of an MMT, read it as a job: lightning job logs <machine-name>.
--tail prints the last N lines; --follow (-f) keeps the stream open
until the resource finishes or you press Ctrl-C:
$ lightning job logs sdk-tutorial-job --tail 100
$ lightning deployment logs sdk-tutorial-api --follow
$ lightning mmt logs sdk-tutorial-mmt --tail 50 --follow--query keeps only lines containing every whitespace-separated term,
--severity sets the minimum level (error > warning > info >
debug), and --since/--until bound the time range. Time bounds take a
duration — 30s, 5m, 2h, 3d, 1w — or an RFC3339 timestamp:
$ lightning job logs sdk-tutorial-job --query "CUDA out of memory"
$ lightning deployment logs sdk-tutorial-api --severity warning --since 2h
$ lightning mmt logs sdk-tutorial-mmt --query error --since 3d --until 1d
$ lightning job logs sdk-tutorial-job --since 2026-01-01T00:00:00ZFilters combine with --tail and --follow, so you can watch only what
matters, and --timestamps prefixes each line with its ISO-8601 timestamp:
$ lightning deployment logs sdk-tutorial-api --severity error --follow
$ lightning job logs sdk-tutorial-job --tail 200 --timestampsA sandbox reads by id, and an optional command id narrows to a single detached command; omit it for the merged logs of every command in the sandbox:
$ lightning sandbox logs sbx-42
$ lightning sandbox logs sbx-42 cmd-abc123
$ lightning sandbox logs sbx-42 --query errorjobs_cli.rstfor submitting and inspecting the jobs these logs come from.sandboxes_cli.rstfor running detached sandbox commands.lightning job logs --help(alsommt,deployment, andsandbox) for the full option reference.