Best place for viewing production logs? Moving from Vercel
I'm in the process of moving from Vercel to Pages, and I'm looking for the best way to replicate Vercel's Logs page (picture attached). I see that in CF in Deployment details > Functions, I can stream from one of the deployments and click in to see logs (and I can use Wrangler CLI to filter more closely). Am I correct that this is the closest to the Vercel Logs page?
Also, I notice that when I send back a 400 via nextjs, the CF logs (both in the dash and via wrangler) say OK. Browser correctly shows the 400 as an error.
8 Replies
I'm not sure about Vercel's log page but the tail with Workers is only transient/doesn't keep logs. There's plugins for Sentry and Honeycomb if you wanted longer storage
The outcome != http status, that outcome there is just saying the worker finished executing without any issues
https://developers.cloudflare.com/workers/runtime-apis/handlers/tail/#properties-1
ah ty, okay will look into sentry or something else. yeah vercel saves the last 100k logs for pro tier, which is very helpful
and ty for clarifying on outcome != http status. do you know if there's a way to see errors more directly in the log? would I need to look into each worker log to see if there were any real errors? or maybe this can be done via wrangler
I dug super deep into this issue 3 months ago, I haven't found a way to persist logs. I think that feature will stay on the backlog for a while, unfortunately.
What I did is use separate workers for critical parts of the app (stripe hooks), so that I can logpush to R2. I haven't found a way to conveniently view logs from R2 though.
Following the same logic I'm tempted with moving all the backend (except the next auth stuff because I'm scared haha) to hono on a worker, and logpush to R2.
Let me know if you find a better way!
Axiom
Stop sampling, observe every event – Axiom
100% of your data for every possible need: o11y, security, analytics, and new insights.
^ very cool , thanks for sharing. Also leaving Vercel following their pricing changes.
I'm using baselime.io (free) - had to implement their edge-logger, but that was quick to do: https://baselime.io/docs/sending-data/platforms/cloudflare/edge-logger/
Edge Logger | Baselime - The cloud-native observability platform
Cloudflare Logpush is not available in all Cloudflare edge environments. In those environments, it's necessary to emit logs from within the process.
Baselime was recently acquired by Cloudflare