Project key kinds
Each project key belongs to one project. Its kind sets what it can do. You choose the kind with--kind when you run logbrew projects keys create.
The
sdk, server, cli, and browser kinds are ingest keys. Select the
kind that names where the key runs. Use browser for code that runs in a
browser. Never put a read key in browser code, a mobile app, or a public
bundle.
Account access is different. logbrew login gives the CLI the access of your
account. Never use account access as SDK configuration. A read key cannot
sign in to the CLI or the dashboard.
Read your test event back
1
Create a read key
You need account access for this step. Run The CLI writes the key to a new owner-only file. It never prints the key
or the file path.
logbrew status --json and
make sure that it reports authenticated account access.--ingest-key-file is the file option for every key
kind. The destination file must not exist.Checkpoint: the result has status: "created" and
ingest_key.kind: "read". Record ingest_key.id. You need it to revoke
the key.2
Send a test event
Send one safe test log from your application with its project ingest key.
Use the steps for your runtime in the Quickstart or the
SDK ingestion guide. To also test issues, send
one handled test error.Checkpoint: the SDK reports a
2xx status. This shows that LogBrew
accepted the request. Continue to the next step.3
Read the event back
Load the read key into Each read returns data from the key’s project only, so you do not need
LOGBREW_TOKEN for this shell only. Then read the
project:--project. Add --service, --environment, or --release to match
the test event.Checkpoint: the test log appears with your service, environment, and
release. A test error appears as an issue. This shows that LogBrew stored
the events and that you can read them.When you finish, run unset LOGBREW_TOKEN. The CLI then uses your account
access again.4
Revoke the read key
Revoke the key when you no longer need it. This step needs account
access, so unset Checkpoint: the result has
LOGBREW_TOKEN first.status: "revoked". The key stops working
at its next request.Give a CI job or an agent read access
Keep a read key for a CI job or a coding agent that reads one project. Store the key in the secret store of the CI system or the agent environment. Make it available asLOGBREW_TOKEN. Do not put the key in a prompt, a
repository, or command output.
The job or agent can then run reads such as logbrew issues --json,
logbrew issue "<issue_id>" --json, and logbrew read trace "<trace_id>".
Project, key, and account commands need account access. API clients send the
key as a bearer token to the telemetry reads in the
Telemetry API.
Use one key for each job or agent. Then you can revoke one key without an
effect on the others.
Recover from a failed read
If telemetry is still missing, use the
first telemetry checks.
To replace an ingest key, see Rotate an ingest key.
