Pull Your App’s Logs Directly in the Terminal with Shopify CLI 5.2

Shopify CLI 5.2 adds a powerful shopify app logs command that lets developers and merchants fetch historical webhook, API, and Function logs right from their terminal. Learn what changed, who it affects, and how to start using it today.

Pull Your App’s Logs Directly in the Terminal with Shopify CLI 5.2
5 sections

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

  • Upgrade your CLI: npm install -g @shopify/cli@5.2 or later.
  • Log in with your Shopify account: shopify login
  • Navigate to your app’s root folder (or supply --client-id to target a specific app).
  • Run the command you need. For example, to see the last 10 Function runs:
  • shopify app logs --type function --since 12h --limit 10

  • If you prefer JSON output for automation, add --json and pipe it into jq or your own parser.
  • 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.

    Tags
    Sources

    Related Articles

    marketUpdate Now Respects enabled:false: Drafting Markets with Conditions Made Explicit

    marketUpdate Now Respects enabled:false: Drafting Markets with Conditions Made Explicit

    Shopify’s Admin GraphQL API now treats enabled:false as a draft status for condition‑backed markets. Learn what changed, who’s affected, and how to update your apps to avoid silent failures.

    December 2, 20264 min
    Shop Update Webhooks Now Reveal Market‑Driven Shipping Status

    Shop Update Webhooks Now Reveal Market‑Driven Shipping Status

    Shopify’s latest webhook update adds market‑driven shipping status to shop update events, giving developers and merchants richer order fulfillment data. Learn what changed, who needs to act, and how to adapt your integrations today.

    December 2, 20264 min
    Ship and Pickup Together: Storefront API Cart Delivery Groups Now Support Pickup

    Ship and Pickup Together: Storefront API Cart Delivery Groups Now Support Pickup

    Shopify’s Storefront API now returns multiple delivery groups—including pickup—in cart queries, aligning cart data with checkout selections. Developers must update their integrations to handle split shipping and pickup groups and avoid broken experiences.

    December 2, 20265 min
    displayName No Longer Shows Unapproved Emails or Phones – What Developers Need to Know

    displayName No Longer Shows Unapproved Emails or Phones – What Developers Need to Know

    Shopify’s latest API change hides customer emails and phone numbers in the displayName field unless your app has explicit permission. Learn who is affected, how the change works, and the exact steps to keep your integrations running smoothly.

    December 1, 20264 min