logging
Options
Fetching
You can configure the logging level and whether the full URL is logged to the console when running Next.js in development mode.
Currently,logging only applies to data fetching using thefetch API. It does not yet apply to other logs inside of Next.js.
module.exports= { logging: { fetches: { fullUrl:true, }, },}Anyfetch requests that are restored from theServer Components HMR cache are not logged by default. However, this can be enabled by settinglogging.fetches.hmrRefreshes totrue.
module.exports= { logging: { fetches: { hmrRefreshes:true, }, },}Incoming Requests
By default all the incoming requests will be logged in the console during development. You can use theincomingRequests option to decide which requests to ignore.Since this is only logged in development, this option doesn't affect production builds.
module.exports= { logging: { incomingRequests: { ignore: [/\api\/v1\/health/], }, },}Or you can disable incoming request logging by settingincomingRequests tofalse.
module.exports= { logging: { incomingRequests:false, },}Disabling Logging
In addition, you can disable the development logging by settinglogging tofalse.
module.exports= { logging:false,}Was this helpful?