How to enable logpush with Cloudflare and SvelteKit?

Is there someway with the Cloudflare adapter with SvelteKit to enable logpush?
7 Replies
Chaika
Chaika9mo ago
Sveltekit has an adapter for Cloudflare Pages (adapter-cloudflare ) and an adapter for Cloudflare Workers (adapter-cloudflare-workers). If you're talking about adapter-cloudflare/Cloudflare Pages, Cloudflare Pages does not support logpush/workers trace events at the moment. Only workers do, you could use the worker adapter but you'd lose out on a few things like the Github integration, previews, rollbacks, etc
Cory
Cory9mo ago
ah yea I need things like rollbacks etc At the moment I am just using adapter-cloudflare Which seems to make it so server side requests use "workers" technically? Is that correct?
Chaika
Chaika9mo ago
You're using adapter-cloudflare/Cloudflare Pages, which uses Pages Functions to do server-side requests and such. Functions are built on Workers, but do not support all the same bindings and features right away. They're working on supporting logpush with functions, no eta though
Cory
Cory9mo ago
ah okay thanks!
Zar
Zar9mo ago
don't mean to bump this, but I'm in the same position. are there any good workarounds for now? eg. third party libs we could use to push logs? @Chaika @Cory
Cory
Cory9mo ago
I couldn't find anything
Chaika
Chaika9mo ago
Depends what you want. There's a Sentry plugin for errors: https://developers.cloudflare.com/pages/platform/functions/plugins/sentry/, or Honeycomb for traces: https://developers.cloudflare.com/pages/platform/functions/plugins/honeycomb/ (I haven't personally used either in Pages, I use Sentry Integration in Workers and Workers Trace Events for generic logs)
Honeycomb · Cloudflare Pages docs
The Honeycomb Pages Plugin automatically sends traces to Honeycomb for analysis and observability.
Want results from more Discord servers?
Add your server
More Posts