From 7ec88851dacd1e1e94f51f8978c444bb80e9c9df Mon Sep 17 00:00:00 2001 From: Shinwoo PARK Date: Fri, 28 Mar 2025 15:01:51 +0900 Subject: [PATCH] fix(nestlogged-fastify): use 'raw' instead of kRequestPayloadStream --- packages/nestlogged-fastify/src/logged/override.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/nestlogged-fastify/src/logged/override.ts b/packages/nestlogged-fastify/src/logged/override.ts index 73823c2..0f3e31c 100644 --- a/packages/nestlogged-fastify/src/logged/override.ts +++ b/packages/nestlogged-fastify/src/logged/override.ts @@ -9,7 +9,6 @@ import { } from 'nestlogged/lib/logged/utils'; import { objectContainedLogSync, getItemByPathSync } from 'nestlogged/lib/internals/utils'; import { ScopedLogger } from 'nestlogged/lib/logger'; -import { kRequestPayloadStream } from 'fastify/lib/symbols'; interface FunctionMetadata { scopedLoggerInjectableParam?: number; @@ -79,7 +78,7 @@ export function overrideBuild, R>( 'Cannot inject logger: Request type is not http', ); } else { - let req = ctx.switchToHttp().getRequest()[kRequestPayloadStream]; + let req = ctx.switchToHttp().getRequest()['raw']; if (req[REQUEST_LOG_ID] === undefined) { req[REQUEST_LOG_ID] = ScopedLogger.createScopeId(); } @@ -101,7 +100,7 @@ export function overrideBuild, R>( ); } else if (type === 'route') { // args[metadatas.scopedLoggerInjectableParam] is now Request object, thanks to code in @LoggedRoute!!!! - let req = args[metadatas.scopedLoggerInjectableParam][kRequestPayloadStream]; + let req = args[metadatas.scopedLoggerInjectableParam]['raw']; if (req[REQUEST_LOG_ID] === undefined) { req[REQUEST_LOG_ID] = ScopedLogger.createScopeId(); }