What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Best practice for app / theme / webhook logging

Best practice for app / theme / webhook logging

mcroker
Visitor
1 0 0

What's the recommended way to create logs from either a theme or an app.

 

I have a number of calls to an external service in the theme, and I would want to know if the call fails.  Assuming the call gets to the external service, I can track most log events there -  but how do I know if the call fails to reach the external service (e.g. client side code issues, authentication issue, ...).

 

Similarly I am using webhooks to trigger calls to an external service.  How do I know/track webhook call failures?

Reply 1 (1)

SBD_
Shopify Staff
1831 273 421

Hey @mcroker,

 

Can you please elaborate on your theme setup? How are you calling the external service?

 

Regarding webhook failures, there are no logs as such, but you'll get an email if a webhook continues to fail. From the docs:

 

Shopify has implemented a five second timeout period and a retry period for subscriptions. Shopify waits five seconds for a response to each request to a webhook. If there is no response, or an error is returned, then Shopify retries the connection 19 times over the next 48 hours. A webhook is deleted if there are 19 consecutive failures.

To avoid timeouts and errors, consider deferring app processing until after the webhook response has been successfully sent.

 

 

Scott | Developer Advocate @ Shopify