Next.js Logging: Edge vs. Browser vs. Node
Logging in Next.js is more difficult than you might think. Most logging libraries are only designed to run in Next.js. Some have "hacks" to work in the browser, but almost none will work in the Edge runtime where your middleware lives.
Blog post: https://blog.sentry.io/logging-in-next-js-is-hard-but-it-doesnt-have-to-be
LogTape Video: https://www.youtube.com/watch
Vercel Logs: https://www.youtube.com/watch
Try Sentry for free: https://sentry.io/welcome
Docs: https://docs.sentry.io