{"id":"3a3e72b1150635dd","repo":"fastify/fastify","slug":"fstdep023","errorCode":"FSTDEP023","errorMessage":"disableRequestLogging option is deprecated. Use the logController option with disableRequestLogging or isLogDisabled override instead. The disableRequestLogging top-level option will be removed in `fastify@6`.","messagePattern":"disableRequestLogging option is deprecated\\. Use the logController option with disableRequestLogging or isLogDisabled override instead\\. The disableRequestLogging top-level option will be removed in `fastify@6`\\.","errorType":"console","errorClass":"FastifyDeprecation","httpStatus":null,"severity":"warning","filePath":"lib/warnings.js","lineNumber":56,"sourceCode":"})\n\nconst FSTSEC001 = createWarning({\n  name: 'FastifySecurity',\n  code: 'FSTSEC001',\n  message: 'You are using /%s/ Content-Type which may be vulnerable to CORS attack. Please make sure your RegExp start with \"^\" or include \";?\" to proper detection of the essence MIME type.',\n  unlimited: true\n})\n\nconst FSTDEP022 = createWarning({\n  name: 'FastifyWarning',\n  code: 'FSTDEP022',\n  message: 'The router options for %s property access is deprecated. Please use \"options.routerOptions\" instead for accessing router options. The router options will be removed in `fastify@6`.',\n  unlimited: true\n})\n\nconst FSTDEP023 = createWarning({\n  name: 'FastifyDeprecation',\n  code: 'FSTDEP023',\n  message: 'disableRequestLogging option is deprecated. Use the logController option with disableRequestLogging or isLogDisabled override instead. The disableRequestLogging top-level option will be removed in `fastify@6`.',\n  unlimited: true\n})\n\nconst FSTDEP024 = createWarning({\n  name: 'FastifyDeprecation',\n  code: 'FSTDEP024',\n  message: 'requestIdLogLabel option is deprecated. Use the logController option with requestIdLogLabel instead. The requestIdLogLabel top-level option will be removed in `fastify@6`.',\n  unlimited: true\n})\n\nconst FSTDEP025 = createWarning({\n  name: 'FastifyDeprecation',\n  code: 'FSTDEP025',\n  message: 'Calling addHttpMethod for existing method \"%s\" without { overrideExisting: true } is deprecated. In Fastify v6, this will throw an error.',\n  unlimited: true\n})\n","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/fastify/fastify/blob/7299a57d3fdce7da49f2c6d19ba08dc673e53f22/lib/warnings.js#L38-L74","documentation":"Emitted by fastify.js:889 when the top-level disableRequestLogging option is present (options.disableRequestLogging !== undefined). v5 moved logging control into the logController option; the top-level disableRequestLogging alias will be removed in fastify@6.","triggerScenarios":"Fastify({ disableRequestLogging: true }) or Fastify({ disableRequestLogging: (req) => req.url.includes('/health') }) — any value (boolean or function) at the top level.","commonSituations":"Upgrading from v4/v5.0 where this was the documented way to silence per-request logs; silencing health-check logs; carrying old config forward.","solutions":["Pass a LogController instance via the logController option with disableRequestLogging in its constructor.","Or use the isLogDisabled override on the log controller for per-request decisions."],"exampleFix":"// before — triggers FSTDEP023\nconst { fastify } = require('fastify')\nconst app = fastify({ disableRequestLogging: true })\n\n// after\nconst { fastify, LogController } = require('fastify')\nconst app = fastify({\n  logController: new LogController({ disableRequestLogging: true })\n})","handlingStrategy":"validation","validationCode":"// Fail fast if the deprecated top-level disableRequestLogging is used\nfunction assertNoDisableRequestLogging (options) {\n  if (options && Object.hasOwn(options, 'disableRequestLogging')) {\n    throw new Error('Use logController: new LogController({ disableRequestLogging: ... }) instead of the top-level option')\n  }\n}\nassertNoDisableRequestLogging(fastifyOptions)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Construct logging config via new LogController({ disableRequestLogging, requestIdLogLabel }) and pass it as the logController option.","For per-request decisions use the isLogDisabled override on the log controller.","Grep the codebase for 'disableRequestLogging:' at top level during the v5->v6 migration.","Run with --trace-deprecation to find every deprecated logging option."],"tags":["deprecation","logging","v6-migration"],"analyzedSha":"7299a57d3fdce7da49f2c6d19ba08dc673e53f22","analyzedAt":"2026-08-03T17:43:01.300Z","schemaVersion":2}