Service eligibility and regional restrictions
PuppyIP serves only compliant overseas businesses and their authorized personnel. Proxy services are not available in mainland China. The service may only be used for lawful business activities outside mainland China. Use of this service within mainland China is prohibited.
Hosting a proxy IP or server overseas does not change these restrictions. The service must not be provided to end users in mainland China through relaying, forwarding, sharing or resale. Before use, read the Terms of Service.
Key Takeaways
- Shopify CLI 5.2 adds shopify app logs for one-shot queries of historical app logs.
- The command can retrieve webhook deliveries, GraphQL requests, and Shopify Function runs.
- A query can look back up to 7 days, cover no more than 1 day, and return up to 1,000 records.
- You need a Shopify user account with access to the app's organization; CI/CD automation tokens are not supported.
What changed
Shopify CLI 5.2 adds shopify app logs. It reads historical logs for one app, prints the results, and exits. By default, it looks at the past hour and returns up to 20 records across all supported log types. The records correspond to the app logs in the Dev Dashboard, so the CLI can help you narrow an investigation from your terminal.
Log types include webhook deliveries, GraphQL and REST API requests, Shopify Function runs, App Events, billing events, and UI extension records. Check the current command reference for the available types and their filters. The command does not change app code, replay a webhook, repeat an API request shown in the log, or repair a failed run.
Narrow the query by type and field
Start with --type to select records such as webhook, graphql, or function, then add fields supported by that type. For example, webhooks can be filtered by status, topic, and HTTP status code; GraphQL requests by status, operation type, operation name, or request ID; and Functions by status, Function handle, or target. You can also use --store to select a store.
A type-specific filter only applies to its matching records: combining a webhook topic with a GraphQL operation name does not search each record type separately. Filters combine with AND, and each filter accepts one exact value. To check several different values, run separate queries so you can interpret which condition matched.
Time windows, sorting, and result limits
--since accepts a positive duration or an RFC 3339 timestamp, and its start is inclusive. --until accepts an RFC 3339 timestamp and is exclusive; it defaults to the current time. A query window can be at most one day long, and its start must be within the past seven days. To inspect a longer period, split it into separate daily windows.
--limit accepts at most 1,000 records. When you sort by timestamp, the server sorts before applying the limit, although API query limits still apply. Leaving results unsorted is usually faster and uses less throttle capacity. However, if an unsorted query reaches its limit, the returned set can be an arbitrary subset of matching records, which the CLI then displays oldest first. If fewer records than the limit are returned, all matches available at query time were returned.
Example: find recent failed webhooks
Run the command below from your Shopify app project directory to query failed webhooks from the past 24 hours and select the five newest by timestamp. A single 24-hour window follows the command's limit; for an earlier date, adjust the time range by day instead of extending --since to seven days.
Shopify CLI
bashshopify app logs --type webhook --status failure --since 24h --sort timestamp --order desc --limit 5
Historical queries versus a live development stream
Shopify CLI must use a user account that has access to the app's organization. Automation tokens are not currently supported for shopify app logs, so do not treat it as a headless CI/CD diagnostic step. If an account cannot access the app, the query does not expand that account's existing organization permissions.
Use app logs to look up events that have already happened. To watch Shopify Function logs continuously during development, keep using shopify app dev. Command output is operational data: before sharing it, follow your team's log-access rules and include only what is needed for troubleshooting. Do not publicly paste tokens or unrelated request data.
Sources
Frequently Asked Questions
Does app logs in Shopify CLI 5.2 stream Function logs live?
No. It lists historical records and exits. To watch Function logs live during development, use shopify app dev.
Can one query retrieve everything from the past seven days?
A single query cannot use a seven-day-wide window. Its start can be within the past seven days, but each window is limited to one day. A query can return up to 1,000 records and is also subject to its filters and server-side query limits.
Why might an unsorted result omit the newest matching records?
When an unsorted query reaches --limit, the service can return an arbitrary subset of matches, and the CLI displays that set oldest first. To select the newest records explicitly, use --sort timestamp --order desc, while keeping in mind that sorted queries are still subject to API query limits.
Can a CI/CD token run this command?
Not currently. Use a Shopify user account with access to the app's organization; the command does not bypass organization permissions.