Observe console logs for cron

Where can I observe console logs? I thought this would be straightforward but I don't see anything at logs/live (real time logs) or cron events tab
4 Replies
Jürgen Leschner
To see real-time logs in the dashboard, first select your deployed worker, then look for the "Logs" tab, and click on the blue button "Begin log stream". You should see an event for every console.log. The screenshots are from the "scheduled worker" Application Starter template (npm create wrangler). github You could also try wrangler tail docs
GitHub
GitHub - jldec/create-cron
Contribute to jldec/create-cron development by creating an account on GitHub.
Cloudflare Docs
Real-time logs | Cloudflare Workers docs
Debug your Worker application by accessing logs and exceptions through the Cloudflare dashboard or wrangler tail.
Cloudflare Docs
Commands | Cloudflare Workers docs
Create, develop, and deploy your Cloudflare Workers with Wrangler commands.
No description
No description
devin
devinOP3mo ago
Yeah I tried all that actually and it didn't work for some reason. But I'm also looking for a better long term solution because I need the logs to persist so that I don't have to babysit on execution. Any ideas on it? Maybe dump into KV?
Jürgen Leschner
Yeah, lots of options, depending on the volume and retention and how you want to query etc. KV is more for low-latency reads, R2 for blobs. Tail workers are a nice way to send logs and exceptions to a log store, without changing the worker code. You may also want to try baselime if the free 7-days retention works for you.
Cloudflare Docs
Tail Workers | Cloudflare Workers docs
Track and log Workers on invocation by assigning a Tail Worker to your projects.
Baselime
Baselime - Observability and Error-tracking Platform
Use logs, metrics, distributed tracing and wide-events to detect, diagnose and resolve issues before they impact your users.
Jürgen Leschner
The Cloudflare Blog
Builder Day 2024: 18 big updates to the Workers platform
To celebrate Builder Day 2024, we’re shipping 18 updates inspired by direct feedback from developers building on Cloudflare. This includes new capabilities, like running evals with AI Gateway, beta products like Queues and Vectorize graduating to GA, massive speed improvements to KV and Workers AI, pricing simplifications, and bringing key featu...
Want results from more Discord servers?
Add your server