Next.js Discord

Discord Forum

next js (edge runtime) logging provider/library

Unanswered
Tonkinese posted this in #help-forum
Open in Discord
TonkineseOP
what's a nice logging solution for working with nextjs edge ? (CF pages/workers in paritcular)
i haven't try logging in prod yet so this is very new to me. I've heard of sentry but i'm not sure of the other options.

Most of the free(?) solutions i've found are libraries (pino and winston?) but they're for node. I can't use node tho because of edge.

4 Replies

I'm simply using console funcitons, as all console logs should be sent as logs in CF workers, so If you connect any Log Drain you should get what you sent 😄
@Z4NR34L I'm simply using `console` funcitons, as all console logs should be sent as logs in CF workers, so If you connect any Log Drain you should get what you sent 😄
TonkineseOP
I see, didin't know workers supported log drains
I'm using workers indirectly tho (through CF pages' functions), and afaik the functions don't have support yet for log drains (https://developers.cloudflare.com/pages/platform/functions/debugging-and-logging/#limits )

what provider do you use? might try them
Yeah, you're right, there is no support for log drains currently - but still console.log is working fine to view in cf logs.

I'm using https://vercel.com, with log drain to https://axiom.co. For me it's currently the only choice for maximum time-saving
TonkineseOP
thanks!