How the CLI works
Use readable text in a terminal. Use--json in scripts and coding agents.
Account login is necessary for account reads. Before you start a login, run
logbrew status --json. A person must complete browser authorization.
Project ingest keys send telemetry. They cannot replace account login.
Project creation, key creation, issue status, priority, and assignee changes,
deployments, and support updates change account data. Before you run one, make sure that the action and
the target are correct.
Run logbrew --help to see all commands. Add --help to a command, such as
logbrew read logs --help, to see its flags. Run logbrew help json for the
JSON rules.
Read a project doctor report
Use a project ID fromlogbrew projects --json:
status, checks, and next. Each check has check,
status, and next. The checks are api, auth, project, ingest_key,
setup, telemetry, and logs.
Exit code 0 means that the CLI wrote a report. It does not mean that the
project is ready. Read the report status and each check. A not_checked
check did not pass.
When the project read succeeds, the
logs check is visible, empty,
unavailable, error, or invalid_response. This check does not change the
report status. An empty log result says nothing about other signals. A failed
read is not an empty result.
Use next as recovery guidance. It does not give permission to change account
or project state.
Example: missing account access
Without account credentials, the command makes no API request. It writes this report to standard output and exits with code0:
state, setup_status, or next_action.
Filters
--since accepts a duration such as 24h or 7d, or an RFC 3339 timestamp.
--until accepts an RFC 3339 timestamp. It is an exclusive end time and must
be later than --since. One issue by ID does not accept --until.
Log severity is info, warning, error, or critical. Issue status is the
workflow state of the issue, not its severity. --status ignored is an older
name for --status archived. --status open means unresolved, and
--status closed means resolved. --assignee none selects issues without an
assignee, and --assignee my_teams selects the issues of your teams. Any other
--assignee value fails with invalid_assignee.
The CLI also accepts these aliases: --project-id, --env, --service-name,
--trace-id, --distinct-id, and --level for --severity. Use the names in
the table in new scripts.
This command reads the errors of 1 day:
-- before the text:
Read the issue list
logbrew read issues shows one line for each issue. CLI 0.1.95 or newer adds
the affected users to each line:
With
--json, each issue has user_impact and evidence. Its
next_action points to the issue investigation. Run
logbrew investigate issue "<issue_id>" to read the trace, logs, and
breadcrumbs of the issue.
Select an issue occurrence
An issue groups matching occurrences. Read the issue for its status, occurrence count, and first and last seen times:explain issue or investigate issue for evidence from one occurrence.
Without --occurrence, LogBrew selects the recommended occurrence. This is not
always the latest event. To read the latest event:
--occurrence also accepts recommended, first, or an occurrence ID that
LogBrew returned. These commands reject project, release, environment, and time
filters. Before you compare evidence, read the timestamp of the selected
occurrence. See Investigate an issue for the
evidence fields.
Change issue status and priority
Use 1 issue ID to change 1 issue:archive sets archived, resolve sets resolved, and reopen sets
unresolved. Priority is high, medium, or low. A priority that you set
stays fixed. Otherwise, the priority follows the issue severity.
To change more than 1 issue, add --project. All issues must be in that
project. One command changes up to 100 issues:
updated, unchanged,
or not_found. An unchanged issue already had the requested value. You can
run the same command again after a network failure.
These commands do not ask for confirmation. Check the issue IDs first. Issue
reads and changes show archived instead of ignored, and the priority,
priority_source, and assignee of each issue. See the
issue response.
Assign issues
An issue has 0 or 1 assignee: one account or one team. List the accounts and teams that you can assign in a project:me, or to a team:
--project to change up to 100 issues of that project, as with status
and priority. An account must be able to read the project, and a team must
belong to the project’s organization. To find the issues assigned to you or
your teams:
team #<slug> for a team. If the
account has no name, it shows the email address, then the user ID. An issue
without an assignee shows unassigned.
Owners, history, and the inbox
issues owners lists the suggested owners and the evidence that it checked.
issues ownership set sends local files of at most 128 KiB each. An empty
file clears its text. issues activity and inbox take --limit from 1 to
200, and --cursor-time with --cursor-id from next_cursor. See
Find who owns an issue.
Set severity rules
info, warning, error, critical, or source. source
shows the captured severity again. --ignore hides matching logs from the
default log list. Without --ignore, the rule shows them.
Read the next page
Logs, issues, actions, metrics, and traces accept cursor pagination. Releases do not. Use--pagination cursor for the first page:
logs and next_cursor. A non-null next_cursor has time
and id. Send them with --cursor-time and --cursor-id:
next_cursor is
null. Use the cursor, not the row count, to decide if more pages exist. The
last page can be empty:
issues, actions, or
metrics in place of logs. Traces return traces, next_cursor, and
naming_quality. A trace cursor has time and trace_id. Send trace_id
with --cursor-id.
Live watch
logbrew watch --json streams live logs, issues, and actions. Add logs,
issues, or actions to stream one type. tail, follow, and stream are
aliases of watch. Watch does not support traces or spans.
Watch needs --json. Without it, the command writes watch streams JSON for agents and exits with code 1.
Watch issue events show an archived issue as ignored, without a priority.
Read the issue to get its current status and priority.
Watch accepts only --severity, such as --severity error,critical.
logbrew watch actions does not accept --severity. The CLI
applies this filter after it receives events. It does not reduce what the
server sends. Watch has no project, release, environment, or time filter. For
those filters, use a read command. After a temporary disconnect, the CLI
waits and then reconnects.
Read results and errors
Put--json before or after the command. Read the exit code before you use the
output. Do not parse human-readable output. It can change between versions.
Success output keeps the API response shape. It can be an array or an object.
Without cursor pagination, a log read returns an array. An empty array means
that no logs match. It is not an error.
Errors go to standard error. The exception is
debug-artifacts --json, which
writes errors to standard output. A JSON error has ok, error, message, and
next. Use error as the stable failure code. Examine next before you run
the command it suggests.
For example, logbrew watch traces --json exits with code 2 and writes:
logbrew read logs --limit 0 --json exits with code 2 and writes:
