How to enable logpush with Cloudflare and SvelteKit?
Is there someway with the Cloudflare adapter with SvelteKit to enable logpush?
7 Replies
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, etcah 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?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 thoughah okay thanks!
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
I couldn't find anything
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.