-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Steps:
- Set up next.js template on Cloudflare Pages using this guide
npm install @logtail/next- In
next.config.mjs, addexport default withLogtail(nextConfig) - In
middleware.tsaddexport default withLogtail(middleware) - Create the following
page.tsx
import { log } from "@logtail/next";
export const runtime = "edge";
export default async function Page() {
log.info('Next.js page log test')
return <p>Done</p>
}
- Create a
.env.localwithLOGTAIL_SOURCE_TOKENandLOGTAIL_URL, then test locally usingnpm run dev. - Deploy to Cloudflare with env vars
LOGTAIL_SOURCE_TOKENandLOGTAIL_URLand test.
Results
When running locally, the logs appear as expected. When running on Cloudfare Pages, no logs appear.
Metadata
Metadata
Assignees
Labels
No labels