Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import helmet from '@fastify/helmet';
import swagger from '@fastify/swagger';
import swaggerUi from '@fastify/swagger-ui';
import * as Sentry from '@sentry/node';
import Fastify from 'fastify';
import Fastify, { LogController } from 'fastify';
import fastifyRedis from '@fastify/redis';
import {
BUILD_VERSION,
Expand Down Expand Up @@ -48,11 +48,13 @@ const app = Fastify({
pluginTimeout: 60_000, // allow Redis retryStrategy to exhaust its backoff
requestIdHeader: 'x-request-id',
genReqId: () => randomUUID(),
disableRequestLogging: (req) =>
req.url === '/health' ||
req.url === '/health/version' ||
req.url.startsWith('/api-docs') ||
req.url === '/',
logController: new LogController({
disableRequestLogging: (req) =>
req.url === '/health' ||
req.url === '/health/version' ||
req.url.startsWith('/api-docs') ||
req.url === '/',
}),
});

// Must be called before any plugin registration so Sentry intercepts the full error lifecycle.
Expand Down