wrangler tail --version-id does not show any logs

I am trying to look at logs for a specific Worker version that is not yet deployed (to debug/validate before going live) and tried using
wrangler tail --version-id <version>
wrangler tail --version-id <version>
However it never shows any logs. All I see is:
⛅️ wrangler 4.38.0
───────────────────
Successfully created tail, expires at 2025-09-19T04:54:27Z
Connected to koassets, waiting for logs...
⛅️ wrangler 4.38.0
───────────────────
Successfully created tail, expires at 2025-09-19T04:54:27Z
Connected to koassets, waiting for logs...
I copy pasted the version from the cloudflare dashboard to be sure. I also tried the preview alias I am using on that version in place of <version> but same (and no error). The worker has worker logs enabled. In the dashboard I can see the logs for the deployed version (but only that one). Any ideas? Thanks, Alex
6 Replies
texan
texan3mo ago
You can’t tail logs for a non deployed version/preview: https://developers.cloudflare.com/workers/configuration/previews/
Cloudflare Docs
Preview URLs
Preview URLs allow you to preview new versions of your project without deploying it to production.
texan
texan3mo ago
Feels like we could do a better job here indicating such in wrangler 😅
texan
texan3mo ago
What you could do is a gradual rollout with 100% of your live version and 0% of the version you want to test, and use the version override header to force your previewed version: https://developers.cloudflare.com/workers/configuration/versions-and-deployments/gradual-deployments/?utm_source=chatgpt.com#version-overrides But yeah if you’re using the preview url, you straight up won’t get logs
Cloudflare Docs
Gradual deployments
Incrementally deploy code changes to your Workers with gradual deployments.
alexkli
alexkliOP3mo ago
ok thanks. It is weird that wrangler tail even has a --version-id argument then 😄 my workaround was to temporarily add a response header with the information I wanted to log/debug
texan
texan3mo ago
Well if you’re using gradual rollouts then you can have multiple versions deployed. Glad you got it working!
alexkli
alexkliOP3mo ago
Ok. It would be great to clarify that in the documentation of eg. wrangler tail. That it only works if the version is deployed as part of a gradual rollouts. But no logs for versions that have been just uploaded and accessed via the version url or a preview alias.

Did you find this page helpful?