Unverified Commit c881224e authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Add experimental verbose logging flag (#49250)

Only shows fetch request logs by default and allows opting into verbose
request timings via experimental config.

x-ref: [slack
thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1683236293282549)
parent fd319d39
......@@ -484,6 +484,9 @@ const configSchema = {
},
},
},
logging: {
type: 'string',
},
},
type: 'object',
},
......
......@@ -144,6 +144,7 @@ export interface NextJsWebpackConfig {
}
export interface ExperimentalConfig {
logging?: 'verbose'
appDocumentPreloading?: boolean
strictNextHead?: boolean
clientRouterFilter?: boolean
......
......@@ -1789,7 +1789,7 @@ export default class NextNodeServer extends BaseServer {
)
}
process.stdout.write('\n')
} else {
} else if (this.nextConfig.experimental.logging === 'verbose') {
process.stdout.write(
`- ${chalk.cyan(req.method || 'GET')} ${req.url} ${
res.statusCode
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment