LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

stripe-logs

Tail live Stripe API request logs

TLDR

Tail all sandbox API request logs
$ stripe logs tail
copy
Filter by HTTP method
$ stripe logs tail --filter-http-method [GET]
copy
Filter by request path
$ stripe logs tail --filter-request-path [/v1/customers]
copy
Filter by status class
$ stripe logs tail --filter-status-code-type [4XX]
copy
Combine method and error class
$ stripe logs tail --filter-http-method [POST] --filter-status-code-type [4XX]
copy
Accept several values for one filter
$ stripe logs tail --filter-http-method [GET,POST]
copy
Print logs as JSON
$ stripe logs tail --format [JSON]
copy

SYNOPSIS

stripe logs tail [options]

DESCRIPTION

stripe logs tail is a subcommand of the Stripe CLI. It opens a direct connection to Stripe and prints API request logs from the current sandbox as they arrive, similar to the Logs view in the Dashboard.Each default line includes a timestamp, status, method, path, and a request id that links to the Dashboard log. Combine filters; an entry is shown only when it matches every filter. A single filter may take several values as a comma-separated list.Use --format JSON when piping into jq or other tools.

PARAMETERS

tail

Stream API request logs in real time. This is the only logs subcommand.
--filter-http-method GET|POST|DELETE
Keep requests with these HTTP methods. Repeat or comma-separate for several values.
--filter-request-path path
Keep requests whose path matches a Stripe API path (e.g. `/v1/charges`).
--filter-status-code code
Keep requests with this HTTP status code.
--filter-status-code-type 2XX|4XX|5XX
Keep requests whose status falls in that class.
--filter-request-status SUCCEEDED|FAILED
SUCCEEDED is HTTP 200, 201, or 202. FAILED is 4xx and 5xx.
--filter-source API|DASHBOARD
Keep requests that came from the Stripe API or from the Dashboard.
--filter-ip-address address
Keep requests from this client IP.
--filter-account connectin|connectout|self
Connect only: incoming Connect, outgoing Connect, or non-Connect (`self`) traffic.
--format JSON
Print each log entry as JSON.

INSTALL

brew install stripe
copy

CAVEATS

Requires stripe login. stripe logs tail works only in sandboxes. In live mode the command errors and tells you to stripe switch to a sandbox.Logs appear only while the process is running. Historical logs are not replayed.Filter values are validated: unknown HTTP methods, status classes, sources, or request-status tokens are rejected before the stream starts.

HISTORY

The Stripe CLI was released by Stripe in 2019. logs tail was added so developers can watch API traffic from the same terminal they use for stripe listen and resource commands.

SEE ALSO

stripe(1), stripe-listen(1), jq(1)

RESOURCES

Copied to clipboard
Kai