Shopify CLI version 5.2 adds the shopify app logs command, which lists your app's recent logs in your terminal. It returns the same logs you see in the Dev Dashboard, including webhook deliveries, GraphQL Admin API requests, and Shopify Function runs.
What changed
The new shopify app logs command supports the following options:
- Returns historical log records for one app and then exits. By default, the command returns up to 20 records from the past hour across all log types.
- Filters by log type with
--type, usingwebhook,graphql,rest,function,app-event,app-billing-event, orui-extension. - Filters by store, result, and fields such as webhook topic, HTTP status code, GraphQL operation name, request ID, or Function handle.
- Sets a time window with
--sinceand--until. You can look back up to seven days in windows of up to one day, and return up to 1,000 records with--limit. - Outputs each full record with
--jsonfor scripts and coding agents.
Examples
The following command lists failed webhook deliveries from the past 24 hours:
shopify app logs --type webhook --status failure --since 24h --limit 5This command filters webhook deliveries by status, time window, and limit to surface the most recent failures.
The following command returns the newest GraphQL requests first as JSON:
shopify app logs --type graphql --since 1h --sort timestamp --order desc --jsonThis command returns recent GraphQL Admin API requests in JSON, sorted by timestamp, for use in scripts or other tools.
Who's affected
You can now use Shopify CLI to read logs for any app. Log in to Shopify CLI with your user account to run shopify app logs. Automation tokens for CI/CD don't work with this command yet.
Shopify CLI 5.0 removed the earlier shopify app logs command that streamed Function logs. The new command lists historical logs instead. To stream Function logs while you develop, keep using shopify app dev.
What to do
You don't need to change your app code to use this command.
- Update to Shopify CLI 5.2 or later.
- Run shopify app logs from your app's directory, or pass --client-id to select a specific app.
- Run shopify app logs --help to see each log type and the filters that apply to it.