Skip to content

Commit

Permalink
Add properties for logging to config schema
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen1 committed Jan 14, 2025
1 parent f340be2 commit a632227
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
29 changes: 22 additions & 7 deletions packages/next/src/server/config-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,13 +530,28 @@ export const configSchema: zod.ZodType<NextConfig> = z.lazy(() =>
})
.optional(),
logging: z
.object({
fetches: z
.object({
fullUrl: z.boolean().optional(),
})
.optional(),
})
.union([
z.object({
fetches: z
.object({
fullUrl: z.boolean().optional(),
hmrRefreshes: z.boolean().optional(),
})
.optional(),
incomingRequest: z
.union([
z.boolean(),
z.object({
ignore: z.union([
z.instanceof(RegExp),
z.array(z.instanceof(RegExp)),
]),
}),
])
.optional(),
}),
z.literal(false),
])
.optional(),
modularizeImports: z
.record(
Expand Down
9 changes: 4 additions & 5 deletions packages/next/src/server/config-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -870,11 +870,10 @@ export interface NextConfig extends Record<string, any> {
}
>

logging?: {
fetches?: {
fullUrl?: boolean
}
}
/**
* Logging configuration. Set to `false` to disable logging.
*/
logging?: LoggingConfig

/**
* period (in seconds) where the server allow to serve stale cache
Expand Down

0 comments on commit a632227

Please sign in to comment.