I figured out how to tail the logs on my Cloudflare Workers instance using wrangler, but it's not clear from the fab docs how you'd monitor a real production instance of a fab-deployed project. It would be helpful if this kind of info was present somewhere in the docs since monitoring is a big part of running a prod service.
I did this for a Cloudflare Workers deploy:
yarn add -D @cloudflare/wrangler
touch wrangler.toml
- Add the following to it:
name = "script-name-you-chose-in-fab.config.json5"
type = "webpack"
workers_dev = false
route = "route-you-chose-in-fab.config.json5"
or can omit route, use workers_dev = true for a workers-dev deploy
- renamed the example env vars in
.env used in the fab config to match those that Cloudflare workers expect: CF_ACCOUNT_ID, CF_ZONE_ID, CF_API_TOKEN
yarn add -D dotenv-cli
- Add a
script to package.json: "tail": "dotenv wrangler tail"
Then yarn tail tails the logs as expected.
I figured out how to tail the logs on my Cloudflare Workers instance using
wrangler, but it's not clear from thefabdocs how you'd monitor a real production instance of a fab-deployed project. It would be helpful if this kind of info was present somewhere in the docs since monitoring is a big part of running a prod service.I did this for a Cloudflare Workers deploy:
yarn add -D @cloudflare/wranglertouch wrangler.tomlor can omit route, use
workers_dev = truefor a workers-dev deploy.envused in thefabconfig to match those that Cloudflare workers expect:CF_ACCOUNT_ID,CF_ZONE_ID,CF_API_TOKENyarn add -D dotenv-cliscripttopackage.json:"tail": "dotenv wrangler tail"Then
yarn tailtails the logs as expected.