Shopify merchants and developers love real‑time insight into what’s happening behind the scenes. With the release of Shopify CLI 5.2, you can now fetch your app’s recent logs straight from the terminal, eliminating the need to juggle multiple dashboards.
What’s New in Shopify CLI 5.2
The new shopify app logs command replaces the older streaming‑only version that was removed in CLI 5.0. Instead of a live feed, it pulls historical log records for a single app and then exits, giving you a snapshot of webhook deliveries, GraphQL Admin API calls, REST requests, Function runs, app‑event and billing events, and UI‑extension logs.
How the shopify app logs Command Works
By default the command returns the most recent 20 records from the past hour across all log types. You can narrow the results with a rich set of filters:
• --type <log‑type> — webhook, graphql, rest, function, app‑event, app‑billing‑event, ui‑extension
• --status <status> — success or failure (mainly for webhook logs)
• --since <duration|timestamp> and --until <timestamp> — look back up to seven days, windows of up to one day
• --limit <number> — maximum records (up to 1,000)
• --json — output full records as JSON for scripts
• --sort <field> --order <asc|desc> — custom ordering
• --store <my‑shop.myshopify.com> — filter by store
• --fields <field1,field2,…> — pick specific columns such as webhook topic or HTTP status
Below are two real‑world snippets you can copy into your terminal.
shopify app logs --type webhook --status failure --since 24h --limit 5
The command above surfaces the five most recent failed webhook deliveries in the last 24 hours – perfect for a quick health check.
shopify app logs --type graphql --since 1h --sort timestamp --order desc --json
This returns recent GraphQL Admin API requests as JSON, sorted newest first, ideal for piping into monitoring tools or CI scripts.
Who Needs to Pay Attention
• Developers – you get a fast, CLI‑native way to debug webhooks, API calls, and Functions without leaving your code editor.
• Merchants building custom apps – the same command works for any app you own, as long as you’re logged into the CLI with a user account that has access.
• CI/CD pipelines – automation tokens currently cannot run shopify app logs, so you’ll need to trigger the command locally or wait for a future update.
Step‑by‑Step: Getting Your Logs Today
shopify app logs --type function --since 12h --limit 10
Best Practices & Automation Tips
• Save common filters in a shell alias, e.g., alias shopify-fail='shopify app logs --type webhook --status failure --since 24h'
• Combine --json with jq to create alert scripts that notify Slack when a webhook fails repeatedly.
