Skip to content

logging

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 the fetch API. It does not yet apply to other logs inside of Next.js.

next.config.js
module.exports = {
  logging: {
    fetches: {
      fullUrl: true,
    },
  },
}

Any fetch requests that are restored from the Server Components HMR cache are not logged by default. However, this can be enabled by setting logging.fetches.hmrRefreshes to true.

next.config.js
module.exports = {
  logging: {
    fetches: {
      hmrRefreshes: true,
    },
  },
}

In addition, you can disable the development logging by setting logging to false.

next.config.js
module.exports = {
  logging: false,
}