Log fetch requests during client-side navigation (#67925)
When the config `logging.fetches` (see https://nextjs.org/docs/app/api-reference/next-config-js/logging) is defined, any fetch requests that are done in server components should be logged. This is currently not the case for client-side navigations in the app router. This PR fixes that, and also cleans up the log format a bit. In addition, cached requests for the purpose of HMR refreshes (see #67527) are explicitly omitted from the logs. **Before** <img width="963" alt="fetch logs before" src="https://github.com/user-attachments/assets/f3d50495-1168-4e75-933e-635931f6efb0"> **After** <img width="908" alt="fetch logs after" src="https://github.com/user-attachments/assets/0933964c-1e02-4f14-b059-1ce536abec71"> Note that warnings for conflicting fetch cache configs are now co-located with the logged fetch metrics. If `logging.fetches` is not enabled, the warnings are still logged, as was the case before. They are now only logged in dev mode though, which was not the case before.
Showing
Please
register
or
sign in
to comment