Where is the wrangler.toml file ?

To keep Logs enabled on my Worker, it seems I need to do what's on the screenshot. That's all well and good, but where is that file ? I only have a worker.js file in the edit UI.
No description
11 Replies
texan
texan•5d ago
Hey @TheCarpetMerchant , if you're editing a worker in the UI, you can enable observability by going into the "Logs" tab and clicking the blue "Enable" button in the table below.
TheCarpetMerchant
TheCarpetMerchantOP•5d ago
Yes, but everytime you deploy that gets reset. Hence why the UI helpfully provides a solution, but unfortunately doesn't tell you where to apply it
Walshy
Walshy•5d ago
It shouldn't reset if you deploy using Quick Edit it'd only reset if you deploy with Wrangler in which case you will have a wrangler.toml file if it is resetting during a Quick Edit deploy that's a bug
TheCarpetMerchant
TheCarpetMerchantOP•5d ago
By Quick Edit, do you mean this ?
No description
TheCarpetMerchant
TheCarpetMerchantOP•5d ago
Because if so yes, it does get reset when going there, making a change and hitting "deploy" But in any case I'd rather know where to put this wrangler file ?
Walshy
Walshy•5d ago
I'm not sure what that icon is, I mean the Edit Code here in the dashboard
No description
Walshy
Walshy•5d ago
where is that screenshot from? In the root but if you're using quick edit that won't work (since it isn't wrangler)
TheCarpetMerchant
TheCarpetMerchantOP•5d ago
This documentation never talks about the file's location, nor does it provide an example repo
Cloudflare Docs
Configuration - Wrangler · Cloudflare Workers docs
Use a configuration file to customize the development and deployment setup for your Worker project and other Developer Platform products.
TheCarpetMerchant
TheCarpetMerchantOP•5d ago
https://dash.cloudflare.com/hash/workers/services/view/my-worker-name/production What's weird is that I had it like you before, and then it changed to just the icon. Not great UI
Walshy
Walshy•5d ago
I've never seen it with just the icon 🤔 Regardless, sounds like there's a bug If you want to use Wrangler, you need to install Wrangler and create a wrangler.toml in the root like this:
name = "my-worker"
compatibility_date = "2025-01-16"

[observability]
enabled = true
name = "my-worker"
compatibility_date = "2025-01-16"

[observability]
enabled = true
@zecanard
@zecanard•4h ago
I’ve had to add a task to my cron Worker to reenable Observability every minute on all my Workers, because it gets disabled every time you deploy from Dashboard. I’ve had the QuickEdit icon changed over the weekend as well.

Did you find this page helpful?