Skip to content

Conversation

@jonmcwest
Copy link
Contributor

@jonmcwest jonmcwest commented Jan 28, 2026

Changes

Improved the Next.js logs installation guide with better practices for handling log flushing in serverless environments:

  1. Moved the LoggerProvider creation outside the register() function so it can be exported and used in route handlers
  2. Added instructions for manually flushing logs using the after() function from next/server
  3. Repositioned the note about Next.js 15+ instrumentation hook being enabled by default to appear before the code example
  4. Added Next.js to the logs installation navigation menu

These changes ensure logs are properly sent before serverless functions freeze, which is critical for reliable logging in Next.js applications.

Checklist

  • I've read the docs and/or content style guides.
  • Words are spelled using American English
  • Use relative URLs for internal links
  • I've checked the pages added or changed in the Vercel preview build
  • If I moved a page, I added a redirect in vercel.json

@vercel
Copy link

vercel bot commented Jan 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
posthog Ready Ready Preview Jan 28, 2026 9:18pm

Request Review

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@jonmcwest jonmcwest marked this pull request as ready for review January 28, 2026 19:22
@corywatilo
Copy link
Collaborator

Also missing nav link for Next.js

#14614 (comment)

@jonmcwest jonmcwest force-pushed the 01-28-docs_logs_clarify_instrumentation_hook_requirements_for_next.js_15_ branch from 24996ba to 29df74c Compare January 28, 2026 20:45
@jonmcwest jonmcwest force-pushed the 01-28-docs_logs_clarify_instrumentation_hook_requirements_for_next.js_15_ branch from 29df74c to 4405c5d Compare January 28, 2026 20:54
@jonmcwest jonmcwest changed the title docs(logs): Clarify instrumentation hook requirements for Next.js 15+ docs(logs): update nextjs logs implementation docs Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants