Help! Cloudflare Pages Logging Woes – Need Solutions!

I just moved my Next.js app from Vercel to Cloudflare Pages. Everything’s been cool so far, but I hit a snag with logging. On Vercel, I could check out past logs, which was super handy for checking out errors after they happened. But now on Cloudflare Pages, it seems like they only show real-time logs and don’t keep any history. 🤔 Has anyone else run into this? Got any tips or tricks to keep logs around for longer? Any help would be awesome! 🙏 Thanks!
2 Replies
Chaika
Chaika5mo ago
#pages-help
But now on Cloudflare Pages, it seems like they only show real-time logs and don’t keep any history. 🤔
that's how tail works yea, would be a lot of data to keep the invocation results of every request
Has anyone else run into this? Got any tips or tricks to keep logs around for longer?
There's a few options, although the logging experience with Pages isn't great right now. There's a sentry plugin: https://developers.cloudflare.com/pages/functions/plugins/sentry/ Cloudflare has also recently bought Baselime which has a pretty good free plan now and you can use it with Pages: https://baselime.io/docs/sending-data/platforms/cloudflare/pages/ Sadly you can't use Workers Trace Events/logpush doesn't work with Pages right now, and there are some open telemetry libraries but they don't support pages afaik, which are both a common go to/what I use personally. Longer term they are working on converging Pages and Workers into the same product/experience, which is nice for the future but probably makes either of those features coming in the short term less likely
Cloudflare Docs
Sentry · Cloudflare Pages docs
The Sentry Pages Plugin captures and logs all exceptions which occur below it in the execution chain of your Pages Functions. It is therefore …
Zane
ZaneOP5mo ago
Thank you very much. I'll try it!
Want results from more Discord servers?
Add your server