logging
Control what the dev server prints: fetches, requests, Server Functions and browser output.
logging?: false | { fetches?: { fullUrl?: boolean; hmrRefreshes?: boolean }; serverFunctions?: boolean; incomingRequests?: boolean | { ignore: RegExp[] }; browserToTerminal?: boolean | 'warn' | 'error' }- Added in Next.js v14.0.0
Parameters
| Parameter | Type | Description |
|---|---|---|
$fetches.fullUrloptional | boolean= false | Logs the complete URL of each fetch made during development instead of an abbreviated form. |
$fetches.hmrRefreshesoptional | boolean= false | Also logs fetch requests restored from the Server Components HMR cache, which are skipped by default. |
$serverFunctionsoptional | boolean= true | Logs each Server Function invocation with its name, arguments and duration. Set to false to disable. |
$incomingRequestsoptional | boolean | { ignore: RegExp[] }= true | Logs incoming requests during development. Pass false to disable, or an object with an ignore array of regular expressions to skip matching paths. |
$browserToTerminaloptional | boolean | 'warn' | 'error'= false | Forwards browser console output to the terminal with source location. true forwards log, info, warn and error; 'warn' forwards warnings and errors; 'error' forwards only errors; false disables forwarding. |
$loggingoptional | false= undefined | Passing false instead of an object disables development logging entirely. |
Changelog
- PHP v16.2.0browserToTerminal added, moved from experimental.browserDebugInfoInTerminal.
- PHP v15.4.0experimental.browserDebugInfoInTerminal introduced.
- PHP v15.2.0incomingRequests added.
- PHP v15.0.0logging: false added, and fetches.hmrRefreshes added for the App Router.
- PHP v14.0.0logging.fetches moved to stable for the App Router.
Everything here affects the development terminal only; production builds are untouched. The options divide into four independent streams.
fetches.fullUrlprints the whole URL of each server-side fetch, so you can see the query string an upstream call actually sent.fetches.hmrRefreshesadditionally shows fetches served from the Server Components HMR cache, which are hidden by default.serverFunctionsis on by default and prints each call as└─ ƒ myAction(arg1, arg2) in 5ms app/actions.ts.incomingRequestslogs every request;{ ignore: [...] }takes regular expressions, which is how you silence a health check that fires every second.browserToTerminalforwardsconsolecalls from the browser into the terminal with file and line, so you can debug a Client Component without switching to DevTools.
What trips people up
fullUrl prints query strings verbatim — API keys and signed tokens included — into your terminal and any scrollback you share. Server Function logging prints arguments, so a form's field values land in the log too. And logging: false silences the routine dev output, not compile or runtime errors.
Example
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
logging: {
fetches: {
fullUrl: true,
},
},
}
export default nextConfigWhen to use it
- See the exact upstream URL, query string included, that a Server Component fetch requested.
- Stop a health check endpoint from flooding the dev terminal.
- Read Client Component console output in the terminal instead of switching to browser DevTools.
Frequently asked questions
How do I see the full fetch URL in the Next.js dev server logs?
Set logging.fetches.fullUrl to true in next.config and restart the dev server. Add fetches.hmrRefreshes: true if you also want fetches served from the Server Components HMR cache, which are hidden by default.
How do I stop health check requests from filling the dev terminal?
Pass logging.incomingRequests: { ignore: [/\/api\/v1\/health/] } with a regular expression matching the path. Setting incomingRequests to false disables request logging entirely.
Can I see browser console.log output in the terminal?
Yes, set logging.browserToTerminal to true for all console output, or 'warn' / 'error' to forward only those levels. Forwarded lines include the source file and line number. The option was added in v16.2.0, replacing experimental.browserDebugInfoInTerminal.
More examples
Quieting a noisy dev terminal
The ignore array takes regular expressions matched against incoming requests, so a health check polling once a second stops burying the logs you care about. Turning off serverFunctions also stops action arguments — which may include whatever a user typed into a form — from being printed.
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
logging: {
incomingRequests: {
ignore: [/\/api\/v1\/health/, /\/__probe/],
},
serverFunctions: false,
},
}
export default nextConfigDebugging a Client Component from the terminal
With 'warn', only console.warn and console.error cross over; true forwards log and info as well. Each forwarded line carries its source location, so a warning prints as [browser] Hello World (app/page.tsx:8:17) and you can jump straight to it without opening DevTools.
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
logging: {
browserToTerminal: 'warn',
},
}
export default nextConfigTurning development logging off
The false shorthand replaces the whole object and silences routine development output. Compile errors and runtime errors are still reported — this hides the request and fetch chatter, not the failures.
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
logging: false,
}
export default nextConfig
Discussion