Skip to main content

logs

Read your driver's log entries from the terminal, scoped to the controller and the exact version you just deployed. No copying them out of the web app.

Usage​

driverforge logs [options]

logs prints the newest log entries your driver reported to Anvil, oldest first. Inside a driver project it needs no flags: it reads the project from .driverforge/config.json and the controller you chose with driverforge device select.

The usual loop after a change is to deploy, trigger the driver action, and read what the driver logged for that deploy only:

driverforge deploy
driverforge logs --version 2026110502 --until-match '"data"' --timeout 30s

driverforge errors and driverforge events work the same way, with the same options, for error occurrences and events.

Prerequisites​

  • You're signed in (driverforge login)
  • Your driver uses the Anvil SDK and the Anvil Agent is installed on the controller, so there is telemetry to read

Choosing what to read​

Each part of the scope is taken from the first place that sets it:

  1. A flag: --org, --project, --device
  2. An environment variable: DRIVERFORGE_ORG, DRIVERFORGE_PROJECT, DRIVERFORGE_DEVICE
  3. The project's .driverforge/config.json (organization and project)
  4. Your selected organization and controller

A flag only affects that one run; it never changes your selection. With --org, --project, --device and --version, the command works anywhere, with no project and no saved selection, which is what CI needs.

Without --since, a read searches as far back as your plan keeps telemetry, and so does --version latest. --since takes a duration such as 30s, 10m or 720h (30 days), or an RFC 3339 time.

The CLI never prompts here. If no controller is selected and your organization has more than one, the command stops and lists them so you can pass --device.

Versions​

--versionReads
(not given)Every version
<n>That driver version
latestThe highest version the controller has reported

Pass the version driverforge deploy printed. latest may be another developer's deploy on a shared controller.

Version filtering needs a driver built with an SDK that tags logs and events with their version. Entries from older SDKs have no version and only appear when you don't filter by one.

Options​

OptionDescription
--orgOrganization slug, name or id
--projectProject slug, name or id
--deviceController name, hostname, hardware id or id
--versionA version number or latest (see above)
--sinceStart of the window: a duration (30s, 10m, 2h) or an RFC 3339 time
--untilEnd of the window, in the same forms
--tailHow many of the newest entries to return (default 100, at most 1000)
--beforePage back from the next_cursor of a previous response
--levelComma-separated levels, e.g. warn,error
--grepRegular expression matched against the message
--ignore-case, -iMake --grep case-insensitive
--correlation-idOnly entries from one event (its trace id)
--fieldA key=value facet filter; repeatable. Keys: controller, driver, level
--until-matchWait until an entry matching this regular expression arrives
--min-eventsWait until this many entries match
--timeoutLongest wait (default 30s when waiting, at most 10m)
--follow, -fStream entries as they arrive, until interrupted or --timeout
--output, -otext, json or jsonl
--max-payload-bytesCap each entry's message and arguments (default 65536; 0 for no cap)

Waiting for output​

--until-match and --min-events turn a read into a wait: the command returns as soon as the condition is met, including by entries that had already arrived, and gives up after --timeout. It watches the same live stream the web app does, falling back to polling if the stream is unavailable, and never shows an entry twice.

--follow streams every new entry until you press Ctrl+C.

Output​

On a terminal the output is readable text, with the scope it used printed first. Piped, or run by a coding agent, it is JSON: one document with a scope, the entries and any warnings; with --follow, one JSON line per entry. Data goes to stdout and everything else to stderr, so you can pipe straight into jq.

Messages are printed exactly as the driver logged them. A log's payload is {"args": […], "argsTruncated": false} when the log call was given anything but strings, and null otherwise: args holds the call's arguments as structured JSON, and argsTruncated is true when the SDK's size limits cut them (see Tables and Other Values). As text, the arguments print as indented JSON under the log line.

A message or arguments longer than --max-payload-bytes is cut, marked as truncated, and the command prints a driverforge get command that fetches the entry in full.

Example​

scope: org=acme project=poolpump device=Living Room version=20261105.2

2026-11-05T03:12:44.218Z INFO v20261105.2 ExecuteCommand playing episode 4812

Warnings​

A read that succeeds can still carry warnings, each with a stable code:

CodeMeaning
no_entriesNothing matched the scope and filters.
retention_clamped--since reaches past your plan's retention; only the last details.window_minutes were searched.
tail_clamped--tail is over the maximum; the newest page was returned. Page further with --before.
payload_truncatedSome entries were cut at --max-payload-bytes. Each is listed in details.entries; driverforge get fetches it in full.
device_not_reportingThe controller hasn't reported to Driverforge for 5 minutes or more; details.last_seen_at is when it last did (RFC 3339, UTC). Empty results from a controller that isn't reporting say nothing about the driver: check the controller first.

A wait that times out on a controller that isn't reporting still exits 3; its wait_timeout error carries details.device_not_reporting: true and details.last_seen_at, and its hint says to check the controller and its Anvil agent rather than to wait longer.

Exit status​

StatusMeaning
0Success, including a read that found nothing
1Unexpected failure, or the connection dropped for over a minute
2A bad flag or value
3A wait ended at --timeout without its condition being met
4Not signed in, or the session expired
5The organization, project or device couldn't be resolved
6Rate limited
130Interrupted

Examples​

Read what the last deploy logged:

driverforge logs --version 2026110502

Read from a specific controller and version, with no project or selection:

driverforge logs --org acme --project smart-tv --device bench-a --version 12 --tail 50

Warnings and errors from the last ten minutes:

driverforge logs --level warn,error --since 10m

Global flags​

Every driverforge command also accepts these global flags: --verbose/-v, --project-dir, --no-tui, --no-update-check, and --help/-h. See the overview for details.